.class public abstract Lorg/microemu/device/impl/DeviceImpl;
.super Ljava/lang/Object;
.source "DeviceImpl.java"

# interfaces
.implements Lorg/microemu/device/Device;


# static fields
.field public static final DEFAULT_LOCATION:Ljava/lang/String; = "org/microemu/device/default/device.xml"

.field private static specialInheritanceAttributeSet:Ljava/util/Map;


# instance fields
.field private buttons:Ljava/util/Vector;

.field private context:Lorg/microemu/EmulatorContext;

.field private descriptorLocation:Ljava/lang/String;

.field private hasPointerEvents:Z

.field private hasPointerMotionEvents:Z

.field private hasRepeatEvents:Z

.field private name:Ljava/lang/String;

.field private normalImage:Ljavax/microedition/lcdui/Image;

.field private overImage:Ljavax/microedition/lcdui/Image;

.field private pressedImage:Ljavax/microedition/lcdui/Image;

.field private skinVersion:I

.field private softButtons:Ljava/util/Vector;

.field private systemProperties:Ljava/util/Map;


# direct methods
.method public constructor <init>()V
    .locals 1

    .prologue
    .line 88
    invoke-direct {p0}, Ljava/lang/Object;-><init>()V

    .line 90
    new-instance v0, Ljava/util/HashMap;

    invoke-direct {v0}, Ljava/util/HashMap;-><init>()V

    iput-object v0, p0, Lorg/microemu/device/impl/DeviceImpl;->systemProperties:Ljava/util/Map;

    .line 91
    new-instance v0, Ljava/util/Vector;

    invoke-direct {v0}, Ljava/util/Vector;-><init>()V

    iput-object v0, p0, Lorg/microemu/device/impl/DeviceImpl;->buttons:Ljava/util/Vector;

    .line 92
    new-instance v0, Ljava/util/Vector;

    invoke-direct {v0}, Ljava/util/Vector;-><init>()V

    iput-object v0, p0, Lorg/microemu/device/impl/DeviceImpl;->softButtons:Ljava/util/Vector;

    .line 93
    return-void
.end method

.method private static besourceBase(Ljava/lang/String;)Ljava/lang/String;
    .locals 2
    .parameter "descriptorLocation"

    .prologue
    .line 798
    const/4 v0, 0x0

    const-string v1, "/"

    invoke-virtual {p0, v1}, Ljava/lang/String;->lastIndexOf(Ljava/lang/String;)I

    move-result v1

    invoke-virtual {p0, v0, v1}, Ljava/lang/String;->substring(II)Ljava/lang/String;

    move-result-object v0

    return-object v0
.end method

.method public static create(Lorg/microemu/EmulatorContext;Ljava/lang/ClassLoader;Ljava/lang/String;Ljava/lang/Class;)Lorg/microemu/device/impl/DeviceImpl;
    .locals 8
    .parameter "context"
    .parameter "classLoader"
    .parameter "descriptorLocation"
    .parameter "defaultDeviceClass"
    .annotation system Ldalvik/annotation/Throws;
        value = {
            Ljava/io/IOException;
        }
    .end annotation

    .prologue
    .line 97
    invoke-static {p1, p2}, Lorg/microemu/device/impl/DeviceImpl;->loadDeviceDescriptor(Ljava/lang/ClassLoader;Ljava/lang/String;)Lnanoxml/XMLElement;

    move-result-object v2

    .line 99
    .local v2, doc:Lnanoxml/XMLElement;
    const/4 v0, 0x0

    .line 100
    .local v0, device:Lorg/microemu/device/impl/DeviceImpl;
    invoke-virtual {v2}, Lnanoxml/XMLElement;->enumerateChildren()Ljava/util/Enumeration;

    move-result-object v3

    .local v3, e:Ljava/util/Enumeration;
    :cond_0
    invoke-interface {v3}, Ljava/util/Enumeration;->hasMoreElements()Z

    move-result v6

    if-eqz v6, :cond_1

    .line 101
    invoke-interface {v3}, Ljava/util/Enumeration;->nextElement()Ljava/lang/Object;

    move-result-object v5

    check-cast v5, Lnanoxml/XMLElement;

    .line 102
    .local v5, tmp:Lnanoxml/XMLElement;
    invoke-virtual {v5}, Lnanoxml/XMLElement;->getName()Ljava/lang/String;

    move-result-object v6

    const-string v7, "class-name"

    invoke-virtual {v6, v7}, Ljava/lang/String;->equals(Ljava/lang/Object;)Z

    move-result v6

    if-eqz v6, :cond_0

    .line 104
    :try_start_0
    invoke-virtual {v5}, Lnanoxml/XMLElement;->getContent()Ljava/lang/String;

    move-result-object v6

    const/4 v7, 0x1

    invoke-static {v6, v7, p1}, Ljava/lang/Class;->forName(Ljava/lang/String;ZLjava/lang/ClassLoader;)Ljava/lang/Class;

    move-result-object v1

    .line 105
    .local v1, deviceClass:Ljava/lang/Class;
    invoke-virtual {v1}, Ljava/lang/Class;->newInstance()Ljava/lang/Object;

    move-result-object v0

    .end local v0           #device:Lorg/microemu/device/impl/DeviceImpl;
    check-cast v0, Lorg/microemu/device/impl/DeviceImpl;
    :try_end_0
    .catch Ljava/lang/ClassNotFoundException; {:try_start_0 .. :try_end_0} :catch_0
    .catch Ljava/lang/InstantiationException; {:try_start_0 .. :try_end_0} :catch_1
    .catch Ljava/lang/IllegalAccessException; {:try_start_0 .. :try_end_0} :catch_2

    .line 117
    .end local v5           #tmp:Lnanoxml/XMLElement;
    .end local v1           #deviceClass:Ljava/lang/Class;
    .restart local v0       #device:Lorg/microemu/device/impl/DeviceImpl;
    :cond_1
    if-nez v0, :cond_2

    .line 119
    :try_start_1
    invoke-virtual {p3}, Ljava/lang/Class;->newInstance()Ljava/lang/Object;

    move-result-object v0

    .end local v0           #device:Lorg/microemu/device/impl/DeviceImpl;
    check-cast v0, Lorg/microemu/device/impl/DeviceImpl;
    :try_end_1
    .catch Ljava/lang/InstantiationException; {:try_start_1 .. :try_end_1} :catch_3
    .catch Ljava/lang/IllegalAccessException; {:try_start_1 .. :try_end_1} :catch_4

    .line 126
    .restart local v0       #device:Lorg/microemu/device/impl/DeviceImpl;
    :cond_2
    iput-object p0, v0, Lorg/microemu/device/impl/DeviceImpl;->context:Lorg/microemu/EmulatorContext;

    .line 127
    invoke-static {p2}, Lorg/microemu/device/impl/DeviceImpl;->besourceBase(Ljava/lang/String;)Ljava/lang/String;

    move-result-object v6

    invoke-virtual {v0, p1, v6, v2}, Lorg/microemu/device/impl/DeviceImpl;->loadConfig(Ljava/lang/ClassLoader;Ljava/lang/String;Lnanoxml/XMLElement;)V

    .line 129
    return-object v0

    .line 106
    .end local v0           #device:Lorg/microemu/device/impl/DeviceImpl;
    .restart local v5       #tmp:Lnanoxml/XMLElement;
    :catch_0
    move-exception v6

    move-object v4, v6

    .line 107
    .local v4, ex:Ljava/lang/ClassNotFoundException;
    new-instance v6, Ljava/io/IOException;

    invoke-virtual {v4}, Ljava/lang/ClassNotFoundException;->getMessage()Ljava/lang/String;

    move-result-object v7

    invoke-direct {v6, v7}, Ljava/io/IOException;-><init>(Ljava/lang/String;)V

    throw v6

    .line 108
    .end local v4           #ex:Ljava/lang/ClassNotFoundException;
    :catch_1
    move-exception v6

    move-object v4, v6

    .line 109
    .local v4, ex:Ljava/lang/InstantiationException;
    new-instance v6, Ljava/io/IOException;

    invoke-virtual {v4}, Ljava/lang/InstantiationException;->getMessage()Ljava/lang/String;

    move-result-object v7

    invoke-direct {v6, v7}, Ljava/io/IOException;-><init>(Ljava/lang/String;)V

    throw v6

    .line 110
    .end local v4           #ex:Ljava/lang/InstantiationException;
    :catch_2
    move-exception v6

    move-object v4, v6

    .line 111
    .local v4, ex:Ljava/lang/IllegalAccessException;
    new-instance v6, Ljava/io/IOException;

    invoke-virtual {v4}, Ljava/lang/IllegalAccessException;->getMessage()Ljava/lang/String;

    move-result-object v7

    invoke-direct {v6, v7}, Ljava/io/IOException;-><init>(Ljava/lang/String;)V

    throw v6

    .line 120
    .end local v5           #tmp:Lnanoxml/XMLElement;
    .end local v4           #ex:Ljava/lang/IllegalAccessException;
    :catch_3
    move-exception v6

    move-object v4, v6

    .line 121
    .local v4, ex:Ljava/lang/InstantiationException;
    new-instance v6, Ljava/io/IOException;

    invoke-virtual {v4}, Ljava/lang/InstantiationException;->getMessage()Ljava/lang/String;

    move-result-object v7

    invoke-direct {v6, v7}, Ljava/io/IOException;-><init>(Ljava/lang/String;)V

    throw v6

    .line 122
    .end local v4           #ex:Ljava/lang/InstantiationException;
    :catch_4
    move-exception v6

    move-object v4, v6

    .line 123
    .local v4, ex:Ljava/lang/IllegalAccessException;
    new-instance v6, Ljava/io/IOException;

    invoke-virtual {v4}, Ljava/lang/IllegalAccessException;->getMessage()Ljava/lang/String;

    move-result-object v7

    invoke-direct {v6, v7}, Ljava/io/IOException;-><init>(Ljava/lang/String;)V

    throw v6
.end method

.method private static expandResourcePath(Ljava/lang/String;Ljava/lang/String;)Ljava/lang/String;
    .locals 4
    .parameter "base"
    .parameter "src"
    .annotation system Ldalvik/annotation/Throws;
        value = {
            Ljava/io/IOException;
        }
    .end annotation

    .prologue
    const-string v3, "/"

    .line 803
    const-string v1, "/"

    invoke-virtual {p1, v3}, Ljava/lang/String;->startsWith(Ljava/lang/String;)Z

    move-result v1

    if-eqz v1, :cond_1

    .line 804
    move-object v0, p1

    .line 808
    .local v0, expandedSource:Ljava/lang/String;
    :goto_0
    const-string v1, "/"

    invoke-virtual {v0, v3}, Ljava/lang/String;->startsWith(Ljava/lang/String;)Z

    move-result v1

    if-eqz v1, :cond_0

    .line 809
    const/4 v1, 0x1

    invoke-virtual {v0, v1}, Ljava/lang/String;->substring(I)Ljava/lang/String;

    move-result-object v0

    .line 811
    :cond_0
    return-object v0

    .line 806
    .end local v0           #expandedSource:Ljava/lang/String;
    :cond_1
    new-instance v1, Ljava/lang/StringBuffer;

    invoke-direct {v1}, Ljava/lang/StringBuffer;-><init>()V

    invoke-virtual {v1, p0}, Ljava/lang/StringBuffer;->append(Ljava/lang/String;)Ljava/lang/StringBuffer;

    move-result-object v1

    const-string v2, "/"

    invoke-virtual {v1, v3}, Ljava/lang/StringBuffer;->append(Ljava/lang/String;)Ljava/lang/StringBuffer;

    move-result-object v1

    invoke-virtual {v1, p1}, Ljava/lang/StringBuffer;->append(Ljava/lang/String;)Ljava/lang/StringBuffer;

    move-result-object v1

    invoke-virtual {v1}, Ljava/lang/StringBuffer;->toString()Ljava/lang/String;

    move-result-object v0

    .restart local v0       #expandedSource:Ljava/lang/String;
    goto :goto_0
.end method

.method private static getFont(Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;)Ljavax/microedition/lcdui/Font;
    .locals 6
    .parameter "face"
    .parameter "style"
    .parameter "size"

    .prologue
    const/4 v5, -0x1

    .line 566
    const/4 v0, 0x0

    .line 567
    .local v0, meFace:I
    const-string v4, "system"

    invoke-virtual {p0, v4}, Ljava/lang/String;->equalsIgnoreCase(Ljava/lang/String;)Z

    move-result v4

    if-eqz v4, :cond_6

    .line 568
    or-int/lit8 v0, v0, 0x0

    .line 575
    :cond_0
    :goto_0
    const/4 v2, 0x0

    .line 576
    .local v2, meStyle:I
    invoke-virtual {p1}, Ljava/lang/String;->toLowerCase()Ljava/lang/String;

    move-result-object v3

    .line 577
    .local v3, testStyle:Ljava/lang/String;
    const-string v4, "plain"

    invoke-virtual {v3, v4}, Ljava/lang/String;->indexOf(Ljava/lang/String;)I

    move-result v4

    if-eq v4, v5, :cond_1

    .line 578
    or-int/lit8 v2, v2, 0x0

    .line 580
    :cond_1
    const-string v4, "bold"

    invoke-virtual {v3, v4}, Ljava/lang/String;->indexOf(Ljava/lang/String;)I

    move-result v4

    if-eq v4, v5, :cond_2

    .line 581
    or-int/lit8 v2, v2, 0x1

    .line 583
    :cond_2
    const-string v4, "italic"

    invoke-virtual {v3, v4}, Ljava/lang/String;->indexOf(Ljava/lang/String;)I

    move-result v4

    if-eq v4, v5, :cond_3

    .line 584
    or-int/lit8 v2, v2, 0x2

    .line 586
    :cond_3
    const-string v4, "underlined"

    invoke-virtual {v3, v4}, Ljava/lang/String;->indexOf(Ljava/lang/String;)I

    move-result v4

    if-eq v4, v5, :cond_4

    .line 587
    or-int/lit8 v2, v2, 0x4

    .line 590
    :cond_4
    const/4 v1, 0x0

    .line 591
    .local v1, meSize:I
    const-string v4, "small"

    invoke-virtual {p2, v4}, Ljava/lang/String;->equalsIgnoreCase(Ljava/lang/String;)Z

    move-result v4

    if-eqz v4, :cond_8

    .line 592
    or-int/lit8 v1, v1, 0x8

    .line 599
    :cond_5
    :goto_1
    invoke-static {v0, v2, v1}, Ljavax/microedition/lcdui/Font;->getFont(III)Ljavax/microedition/lcdui/Font;

    move-result-object v4

    return-object v4

    .line 569
    .end local v2           #meStyle:I
    .end local v3           #testStyle:Ljava/lang/String;
    .end local v1           #meSize:I
    :cond_6
    const-string v4, "monospace"

    invoke-virtual {p0, v4}, Ljava/lang/String;->equalsIgnoreCase(Ljava/lang/String;)Z

    move-result v4

    if-eqz v4, :cond_7

    .line 570
    or-int/lit8 v0, v0, 0x20

    goto :goto_0

    .line 571
    :cond_7
    const-string v4, "proportional"

    invoke-virtual {p0, v4}, Ljava/lang/String;->equalsIgnoreCase(Ljava/lang/String;)Z

    move-result v4

    if-eqz v4, :cond_0

    .line 572
    or-int/lit8 v0, v0, 0x40

    goto :goto_0

    .line 593
    .restart local v1       #meSize:I
    .restart local v2       #meStyle:I
    .restart local v3       #testStyle:Ljava/lang/String;
    :cond_8
    const-string v4, "medium"

    invoke-virtual {p2, v4}, Ljava/lang/String;->equalsIgnoreCase(Ljava/lang/String;)Z

    move-result v4

    if-eqz v4, :cond_9

    .line 594
    or-int/lit8 v1, v1, 0x0

    goto :goto_1

    .line 595
    :cond_9
    const-string v4, "large"

    invoke-virtual {p2, v4}, Ljava/lang/String;->equalsIgnoreCase(Ljava/lang/String;)Z

    move-result v4

    if-eqz v4, :cond_5

    .line 596
    or-int/lit8 v1, v1, 0x10

    goto :goto_1
.end method

.method private getPolygon(Lnanoxml/XMLElement;)Lorg/microemu/device/impl/Polygon;
    .locals 5
    .parameter "source"

    .prologue
    .line 622
    new-instance v1, Lorg/microemu/device/impl/Polygon;

    invoke-direct {v1}, Lorg/microemu/device/impl/Polygon;-><init>()V

    .line 624
    .local v1, poly:Lorg/microemu/device/impl/Polygon;
    invoke-virtual {p1}, Lnanoxml/XMLElement;->enumerateChildren()Ljava/util/Enumeration;

    move-result-object v0

    .local v0, e_poly:Ljava/util/Enumeration;
    :cond_0
    :goto_0
    invoke-interface {v0}, Ljava/util/Enumeration;->hasMoreElements()Z

    move-result v3

    if-eqz v3, :cond_1

    .line 625
    invoke-interface {v0}, Ljava/util/Enumeration;->nextElement()Ljava/lang/Object;

    move-result-object v2

    check-cast v2, Lnanoxml/XMLElement;

    .line 626
    .local v2, tmp_point:Lnanoxml/XMLElement;
    invoke-virtual {v2}, Lnanoxml/XMLElement;->getName()Ljava/lang/String;

    move-result-object v3

    const-string v4, "point"

    invoke-virtual {v3, v4}, Ljava/lang/String;->equals(Ljava/lang/Object;)Z

    move-result v3

    if-eqz v3, :cond_0

    .line 627
    const-string v3, "x"

    invoke-virtual {v2, v3}, Lnanoxml/XMLElement;->getStringAttribute(Ljava/lang/String;)Ljava/lang/String;

    move-result-object v3

    invoke-static {v3}, Ljava/lang/Integer;->parseInt(Ljava/lang/String;)I

    move-result v3

    const-string v4, "y"

    invoke-virtual {v2, v4}, Lnanoxml/XMLElement;->getStringAttribute(Ljava/lang/String;)Ljava/lang/String;

    move-result-object v4

    invoke-static {v4}, Ljava/lang/Integer;->parseInt(Ljava/lang/String;)I

    move-result v4

    invoke-virtual {v1, v3, v4}, Lorg/microemu/device/impl/Polygon;->addPoint(II)V

    goto :goto_0

    .line 632
    .end local v2           #tmp_point:Lnanoxml/XMLElement;
    :cond_1
    return-object v1
.end method

.method private getRectangle(Lnanoxml/XMLElement;)Lorg/microemu/device/impl/Rectangle;
    .locals 5
    .parameter "source"

    .prologue
    .line 603
    new-instance v1, Lorg/microemu/device/impl/Rectangle;

    invoke-direct {v1}, Lorg/microemu/device/impl/Rectangle;-><init>()V

    .line 605
    .local v1, rect:Lorg/microemu/device/impl/Rectangle;
    invoke-virtual {p1}, Lnanoxml/XMLElement;->enumerateChildren()Ljava/util/Enumeration;

    move-result-object v0

    .local v0, e_rectangle:Ljava/util/Enumeration;
    :cond_0
    :goto_0
    invoke-interface {v0}, Ljava/util/Enumeration;->hasMoreElements()Z

    move-result v3

    if-eqz v3, :cond_4

    .line 606
    invoke-interface {v0}, Ljava/util/Enumeration;->nextElement()Ljava/lang/Object;

    move-result-object v2

    check-cast v2, Lnanoxml/XMLElement;

    .line 607
    .local v2, tmp_rectangle:Lnanoxml/XMLElement;
    invoke-virtual {v2}, Lnanoxml/XMLElement;->getName()Ljava/lang/String;

    move-result-object v3

    const-string v4, "x"

    invoke-virtual {v3, v4}, Ljava/lang/String;->equals(Ljava/lang/Object;)Z

    move-result v3

    if-eqz v3, :cond_1

    .line 608
    invoke-virtual {v2}, Lnanoxml/XMLElement;->getContent()Ljava/lang/String;

    move-result-object v3

    invoke-static {v3}, Ljava/lang/Integer;->parseInt(Ljava/lang/String;)I

    move-result v3

    iput v3, v1, Lorg/microemu/device/impl/Rectangle;->x:I

    goto :goto_0

    .line 609
    :cond_1
    invoke-virtual {v2}, Lnanoxml/XMLElement;->getName()Ljava/lang/String;

    move-result-object v3

    const-string v4, "y"

    invoke-virtual {v3, v4}, Ljava/lang/String;->equals(Ljava/lang/Object;)Z

    move-result v3

    if-eqz v3, :cond_2

    .line 610
    invoke-virtual {v2}, Lnanoxml/XMLElement;->getContent()Ljava/lang/String;

    move-result-object v3

    invoke-static {v3}, Ljava/lang/Integer;->parseInt(Ljava/lang/String;)I

    move-result v3

    iput v3, v1, Lorg/microemu/device/impl/Rectangle;->y:I

    goto :goto_0

    .line 611
    :cond_2
    invoke-virtual {v2}, Lnanoxml/XMLElement;->getName()Ljava/lang/String;

    move-result-object v3

    const-string v4, "width"

    invoke-virtual {v3, v4}, Ljava/lang/String;->equals(Ljava/lang/Object;)Z

    move-result v3

    if-eqz v3, :cond_3

    .line 612
    invoke-virtual {v2}, Lnanoxml/XMLElement;->getContent()Ljava/lang/String;

    move-result-object v3

    invoke-static {v3}, Ljava/lang/Integer;->parseInt(Ljava/lang/String;)I

    move-result v3

    iput v3, v1, Lorg/microemu/device/impl/Rectangle;->width:I

    goto :goto_0

    .line 613
    :cond_3
    invoke-virtual {v2}, Lnanoxml/XMLElement;->getName()Ljava/lang/String;

    move-result-object v3

    const-string v4, "height"

    invoke-virtual {v3, v4}, Ljava/lang/String;->equals(Ljava/lang/Object;)Z

    move-result v3

    if-eqz v3, :cond_0

    .line 614
    invoke-virtual {v2}, Lnanoxml/XMLElement;->getContent()Ljava/lang/String;

    move-result-object v3

    invoke-static {v3}, Ljava/lang/Integer;->parseInt(Ljava/lang/String;)I

    move-result v3

    iput v3, v1, Lorg/microemu/device/impl/Rectangle;->height:I

    goto :goto_0

    .line 618
    .end local v2           #tmp_rectangle:Lnanoxml/XMLElement;
    :cond_4
    return-object v1
.end method

.method private getResourceUrl(Ljava/lang/ClassLoader;Ljava/lang/String;Ljava/lang/String;)Ljava/net/URL;
    .locals 5
    .parameter "classLoader"
    .parameter "base"
    .parameter "src"
    .annotation system Ldalvik/annotation/Throws;
        value = {
            Ljava/io/IOException;
        }
    .end annotation

    .prologue
    .line 815
    invoke-static {p2, p3}, Lorg/microemu/device/impl/DeviceImpl;->expandResourcePath(Ljava/lang/String;Ljava/lang/String;)Ljava/lang/String;

    move-result-object v0

    .line 817
    .local v0, expandedSource:Ljava/lang/String;
    invoke-virtual {p1, v0}, Ljava/lang/ClassLoader;->getResource(Ljava/lang/String;)Ljava/net/URL;

    move-result-object v1

    .line 819
    .local v1, result:Ljava/net/URL;
    if-nez v1, :cond_0

    .line 820
    new-instance v2, Ljava/io/IOException;

    new-instance v3, Ljava/lang/StringBuffer;

    invoke-direct {v3}, Ljava/lang/StringBuffer;-><init>()V

    const-string v4, "Cannot find resource: "

    invoke-virtual {v3, v4}, Ljava/lang/StringBuffer;->append(Ljava/lang/String;)Ljava/lang/StringBuffer;

    move-result-object v3

    invoke-virtual {v3, v0}, Ljava/lang/StringBuffer;->append(Ljava/lang/String;)Ljava/lang/StringBuffer;

    move-result-object v3

    invoke-virtual {v3}, Ljava/lang/StringBuffer;->toString()Ljava/lang/String;

    move-result-object v3

    invoke-direct {v2, v3}, Ljava/io/IOException;-><init>(Ljava/lang/String;)V

    throw v2

    .line 823
    :cond_0
    return-object v1
.end method

.method static inheritXML(Lnanoxml/XMLElement;Lnanoxml/XMLElement;Ljava/lang/String;)Lnanoxml/XMLElement;
    .locals 6
    .parameter "parent"
    .parameter "child"
    .parameter "parentName"

    .prologue
    .line 734
    invoke-static {}, Lorg/microemu/device/impl/DeviceImpl;->inheritanceConstInit()V

    .line 735
    if-nez p0, :cond_1

    move-object p0, p1

    .line 784
    .end local p0
    :cond_0
    return-object p0

    .line 738
    .restart local p0
    :cond_1
    invoke-virtual {p1}, Lnanoxml/XMLElement;->getContent()Ljava/lang/String;

    move-result-object v0

    invoke-virtual {p0, v0}, Lnanoxml/XMLElement;->setContent(Ljava/lang/String;)V

    .line 739
    invoke-virtual {p1}, Lnanoxml/XMLElement;->enumerateAttributeNames()Ljava/util/Enumeration;

    move-result-object v0

    .local v0, ena:Ljava/util/Enumeration;
    :goto_0
    invoke-interface {v0}, Ljava/util/Enumeration;->hasMoreElements()Z

    move-result v1

    if-eqz v1, :cond_2

    .line 740
    invoke-interface {v0}, Ljava/util/Enumeration;->nextElement()Ljava/lang/Object;

    move-result-object v1

    check-cast v1, Ljava/lang/String;

    .line 741
    .local v1, key:Ljava/lang/String;
    invoke-virtual {p1, v1}, Lnanoxml/XMLElement;->getAttribute(Ljava/lang/String;)Ljava/lang/Object;

    move-result-object v2

    invoke-virtual {p0, v1, v2}, Lnanoxml/XMLElement;->setAttribute(Ljava/lang/String;Ljava/lang/Object;)V

    goto :goto_0

    .line 743
    .end local v1           #key:Ljava/lang/String;
    :cond_2
    invoke-virtual {p1}, Lnanoxml/XMLElement;->enumerateChildren()Ljava/util/Enumeration;

    move-result-object v1

    .end local v0           #ena:Ljava/util/Enumeration;
    .local v1, enc:Ljava/util/Enumeration;
    :goto_1
    invoke-interface {v1}, Ljava/util/Enumeration;->hasMoreElements()Z

    move-result v0

    if-eqz v0, :cond_0

    .line 744
    invoke-interface {v1}, Ljava/util/Enumeration;->nextElement()Ljava/lang/Object;

    move-result-object v0

    check-cast v0, Lnanoxml/XMLElement;

    .line 745
    .local v0, c:Lnanoxml/XMLElement;
    new-instance v2, Ljava/lang/StringBuffer;

    invoke-direct {v2}, Ljava/lang/StringBuffer;-><init>()V

    invoke-virtual {v2, p2}, Ljava/lang/StringBuffer;->append(Ljava/lang/String;)Ljava/lang/StringBuffer;

    move-result-object v2

    const-string v3, "/"

    invoke-virtual {v2, v3}, Ljava/lang/StringBuffer;->append(Ljava/lang/String;)Ljava/lang/StringBuffer;

    move-result-object v2

    invoke-virtual {v0}, Lnanoxml/XMLElement;->getName()Ljava/lang/String;

    move-result-object v3

    invoke-virtual {v2, v3}, Ljava/lang/StringBuffer;->append(Ljava/lang/String;)Ljava/lang/StringBuffer;

    move-result-object v2

    invoke-virtual {v2}, Ljava/lang/StringBuffer;->toString()Ljava/lang/String;

    move-result-object v2

    sget-object v3, Ljava/util/Locale;->ENGLISH:Ljava/util/Locale;

    invoke-virtual {v2, v3}, Ljava/lang/String;->toUpperCase(Ljava/util/Locale;)Ljava/lang/String;

    move-result-object v3

    .line 747
    .local v3, fullName:Ljava/lang/String;
    const/4 v2, 0x0

    .line 748
    .local v2, inheritWithName:Z
    const-string v2, "name"

    .end local v2           #inheritWithName:Z
    invoke-virtual {v0, v2}, Lnanoxml/XMLElement;->getStringAttribute(Ljava/lang/String;)Ljava/lang/String;

    move-result-object v2

    if-eqz v2, :cond_3

    .line 749
    const/4 v2, 0x1

    .line 755
    .restart local v2       #inheritWithName:Z
    :goto_2
    if-eqz v2, :cond_7

    .line 756
    sget-object v2, Lorg/microemu/device/impl/DeviceImpl;->specialInheritanceAttributeSet:Ljava/util/Map;

    .end local v2           #inheritWithName:Z
    invoke-interface {v2, v3}, Ljava/util/Map;->get(Ljava/lang/Object;)Ljava/lang/Object;

    move-result-object v2

    check-cast v2, [Ljava/lang/String;

    check-cast v2, [Ljava/lang/String;

    .line 757
    .local v2, equalAttributes:[Ljava/lang/String;
    if-eqz v2, :cond_6

    .line 758
    invoke-virtual {v0}, Lnanoxml/XMLElement;->getName()Ljava/lang/String;

    move-result-object v4

    invoke-virtual {v0, v2}, Lnanoxml/XMLElement;->getStringAttributes([Ljava/lang/String;)Ljava/util/Map;

    move-result-object v2

    .end local v2           #equalAttributes:[Ljava/lang/String;
    invoke-virtual {p0, v4, v2}, Lnanoxml/XMLElement;->getChild(Ljava/lang/String;Ljava/util/Map;)Lnanoxml/XMLElement;

    move-result-object v2

    .local v2, p:Lnanoxml/XMLElement;
    :goto_3
    move-object v4, v2

    .line 765
    .end local v2           #p:Lnanoxml/XMLElement;
    .local v4, p:Lnanoxml/XMLElement;
    :goto_4
    const-string v2, "override"

    const/4 v5, 0x0

    invoke-virtual {v0, v2, v5}, Lnanoxml/XMLElement;->getBooleanAttribute(Ljava/lang/String;Z)Z

    move-result v2

    .line 766
    .local v2, inheritOverride:Z
    if-eqz v2, :cond_9

    .line 771
    const-string v2, "override"

    .end local v2           #inheritOverride:Z
    invoke-virtual {v0, v2}, Lnanoxml/XMLElement;->removeAttribute(Ljava/lang/String;)V

    .line 772
    if-eqz v4, :cond_9

    .line 773
    invoke-virtual {p0, v4}, Lnanoxml/XMLElement;->removeChild(Lnanoxml/XMLElement;)V

    .line 774
    const/4 v2, 0x0

    .line 778
    .end local v4           #p:Lnanoxml/XMLElement;
    .local v2, p:Lnanoxml/XMLElement;
    :goto_5
    if-nez v2, :cond_8

    .line 779
    invoke-virtual {p0, v0}, Lnanoxml/XMLElement;->addChild(Lnanoxml/XMLElement;)V

    goto :goto_1

    .line 752
    .end local v2           #p:Lnanoxml/XMLElement;
    :cond_3
    invoke-virtual {v0}, Lnanoxml/XMLElement;->getName()Ljava/lang/String;

    move-result-object v2

    invoke-virtual {p1, v2}, Lnanoxml/XMLElement;->getChildCount(Ljava/lang/String;)I

    move-result v2

    const/4 v4, 0x1

    if-gt v2, v4, :cond_4

    invoke-virtual {v0}, Lnanoxml/XMLElement;->getName()Ljava/lang/String;

    move-result-object v2

    invoke-virtual {p0, v2}, Lnanoxml/XMLElement;->getChildCount(Ljava/lang/String;)I

    move-result v2

    const/4 v4, 0x1

    if-le v2, v4, :cond_5

    :cond_4
    const/4 v2, 0x1

    .local v2, inheritWithName:Z
    :goto_6
    goto :goto_2

    .end local v2           #inheritWithName:Z
    :cond_5
    const/4 v2, 0x0

    goto :goto_6

    .line 760
    .local v2, equalAttributes:[Ljava/lang/String;
    :cond_6
    invoke-virtual {v0}, Lnanoxml/XMLElement;->getName()Ljava/lang/String;

    move-result-object v2

    .end local v2           #equalAttributes:[Ljava/lang/String;
    const-string v4, "name"

    invoke-virtual {v0, v4}, Lnanoxml/XMLElement;->getStringAttribute(Ljava/lang/String;)Ljava/lang/String;

    move-result-object v4

    invoke-virtual {p0, v2, v4}, Lnanoxml/XMLElement;->getChild(Ljava/lang/String;Ljava/lang/String;)Lnanoxml/XMLElement;

    move-result-object v2

    .local v2, p:Lnanoxml/XMLElement;
    goto :goto_3

    .line 763
    .local v2, inheritWithName:Z
    :cond_7
    invoke-virtual {v0}, Lnanoxml/XMLElement;->getName()Ljava/lang/String;

    move-result-object v2

    .end local v2           #inheritWithName:Z
    invoke-virtual {p0, v2}, Lnanoxml/XMLElement;->getChild(Ljava/lang/String;)Lnanoxml/XMLElement;

    move-result-object v2

    .local v2, p:Lnanoxml/XMLElement;
    move-object v4, v2

    .restart local v4       #p:Lnanoxml/XMLElement;
    goto :goto_4

    .line 781
    .end local v4           #p:Lnanoxml/XMLElement;
    :cond_8
    invoke-static {v2, v0, v3}, Lorg/microemu/device/impl/DeviceImpl;->inheritXML(Lnanoxml/XMLElement;Lnanoxml/XMLElement;Ljava/lang/String;)Lnanoxml/XMLElement;

    goto/16 :goto_1

    .end local v2           #p:Lnanoxml/XMLElement;
    .restart local v4       #p:Lnanoxml/XMLElement;
    :cond_9
    move-object v2, v4

    .restart local v2       #p:Lnanoxml/XMLElement;
    goto :goto_5
.end method

.method private static inheritanceConstInit()V
    .locals 5

    .prologue
    .line 724
    sget-object v0, Lorg/microemu/device/impl/DeviceImpl;->specialInheritanceAttributeSet:Ljava/util/Map;

    if-nez v0, :cond_0

    .line 725
    new-instance v0, Ljava/util/Hashtable;

    invoke-direct {v0}, Ljava/util/Hashtable;-><init>()V

    sput-object v0, Lorg/microemu/device/impl/DeviceImpl;->specialInheritanceAttributeSet:Ljava/util/Map;

    .line 726
    sget-object v0, Lorg/microemu/device/impl/DeviceImpl;->specialInheritanceAttributeSet:Ljava/util/Map;

    const-string v1, "//FONTS/FONT"

    const/4 v2, 0x3

    new-array v2, v2, [Ljava/lang/String;

    const/4 v3, 0x0

    const-string v4, "face"

    aput-object v4, v2, v3

    const/4 v3, 0x1

    const-string v4, "style"

    aput-object v4, v2, v3

    const/4 v3, 0x2

    const-string v4, "size"

    aput-object v4, v2, v3

    invoke-interface {v0, v1, v2}, Ljava/util/Map;->put(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;

    .line 728
    :cond_0
    return-void
.end method

.method private static loadDeviceDescriptor(Ljava/lang/ClassLoader;Ljava/lang/String;)Lnanoxml/XMLElement;
    .locals 6
    .parameter "classLoader"
    .parameter "descriptorLocation"
    .annotation system Ldalvik/annotation/Throws;
        value = {
            Ljava/io/IOException;
        }
    .end annotation

    .prologue
    .line 704
    invoke-virtual {p0, p1}, Ljava/lang/ClassLoader;->getResourceAsStream(Ljava/lang/String;)Ljava/io/InputStream;

    move-result-object v0

    .line 705
    .local v0, descriptor:Ljava/io/InputStream;
    if-nez v0, :cond_0

    .line 706
    new-instance v3, Ljava/io/IOException;

    new-instance v4, Ljava/lang/StringBuffer;

    invoke-direct {v4}, Ljava/lang/StringBuffer;-><init>()V

    const-string v5, "Cannot find descriptor at: "

    invoke-virtual {v4, v5}, Ljava/lang/StringBuffer;->append(Ljava/lang/String;)Ljava/lang/StringBuffer;

    move-result-object v4

    invoke-virtual {v4, p1}, Ljava/lang/StringBuffer;->append(Ljava/lang/String;)Ljava/lang/StringBuffer;

    move-result-object v4

    invoke-virtual {v4}, Ljava/lang/StringBuffer;->toString()Ljava/lang/String;

    move-result-object v4

    invoke-direct {v3, v4}, Ljava/io/IOException;-><init>(Ljava/lang/String;)V

    throw v3

    .line 710
    :cond_0
    :try_start_0
    invoke-static {v0}, Lorg/microemu/device/impl/DeviceImpl;->loadXmlDocument(Ljava/io/InputStream;)Lnanoxml/XMLElement;
    :try_end_0
    .catchall {:try_start_0 .. :try_end_0} :catchall_0

    move-result-object v1

    .line 712
    .local v1, doc:Lnanoxml/XMLElement;
    invoke-static {v0}, Lorg/microemu/app/util/IOUtils;->closeQuietly(Ljava/io/InputStream;)V

    .line 715
    const-string v3, "extends"

    invoke-virtual {v1, v3}, Lnanoxml/XMLElement;->getStringAttribute(Ljava/lang/String;)Ljava/lang/String;

    move-result-object v2

    .line 716
    .local v2, parent:Ljava/lang/String;
    if-eqz v2, :cond_1

    .line 717
    invoke-static {p1}, Lorg/microemu/device/impl/DeviceImpl;->besourceBase(Ljava/lang/String;)Ljava/lang/String;

    move-result-object v3

    invoke-static {v3, v2}, Lorg/microemu/device/impl/DeviceImpl;->expandResourcePath(Ljava/lang/String;Ljava/lang/String;)Ljava/lang/String;

    move-result-object v3

    invoke-static {p0, v3}, Lorg/microemu/device/impl/DeviceImpl;->loadDeviceDescriptor(Ljava/lang/ClassLoader;Ljava/lang/String;)Lnanoxml/XMLElement;

    move-result-object v3

    const-string v4, "/"

    invoke-static {v3, v1, v4}, Lorg/microemu/device/impl/DeviceImpl;->inheritXML(Lnanoxml/XMLElement;Lnanoxml/XMLElement;Ljava/lang/String;)Lnanoxml/XMLElement;

    move-result-object v3

    .line 720
    :goto_0
    return-object v3

    .line 712
    .end local v1           #doc:Lnanoxml/XMLElement;
    .end local v2           #parent:Ljava/lang/String;
    :catchall_0
    move-exception v3

    invoke-static {v0}, Lorg/microemu/app/util/IOUtils;->closeQuietly(Ljava/io/InputStream;)V

    throw v3

    .restart local v1       #doc:Lnanoxml/XMLElement;
    .restart local v2       #parent:Ljava/lang/String;
    :cond_1
    move-object v3, v1

    .line 720
    goto :goto_0
.end method

.method private loadImage(Ljava/lang/ClassLoader;Ljava/lang/String;Ljava/lang/String;)Ljavax/microedition/lcdui/Image;
    .locals 2
    .parameter "classLoader"
    .parameter "base"
    .parameter "src"
    .annotation system Ldalvik/annotation/Throws;
        value = {
            Ljava/io/IOException;
        }
    .end annotation

    .prologue
    .line 827
    invoke-direct {p0, p1, p2, p3}, Lorg/microemu/device/impl/DeviceImpl;->getResourceUrl(Ljava/lang/ClassLoader;Ljava/lang/String;Ljava/lang/String;)Ljava/net/URL;

    move-result-object v0

    .line 829
    .local v0, url:Ljava/net/URL;
    invoke-virtual {p0}, Lorg/microemu/device/impl/DeviceImpl;->getDeviceDisplay()Lorg/microemu/device/DeviceDisplay;

    move-result-object p0

    .end local p0
    check-cast p0, Lorg/microemu/device/impl/DeviceDisplayImpl;

    invoke-interface {p0, v0}, Lorg/microemu/device/impl/DeviceDisplayImpl;->createSystemImage(Ljava/net/URL;)Ljavax/microedition/lcdui/Image;

    move-result-object v1

    return-object v1
.end method

.method private loadSkinVersion(Lnanoxml/XMLElement;)V
    .locals 3
    .parameter "doc"

    .prologue
    const/16 v2, 0x4e20

    .line 320
    const-string v1, "xmlns"

    invoke-virtual {p1, v1}, Lnanoxml/XMLElement;->getStringAttribute(Ljava/lang/String;)Ljava/lang/String;

    move-result-object v0

    .line 321
    .local v0, xmlns:Ljava/lang/String;
    if-nez v0, :cond_0

    .line 322
    iput v2, p0, Lorg/microemu/device/impl/DeviceImpl;->skinVersion:I

    .line 330
    :goto_0
    return-void

    .line 324
    :cond_0
    const-string v1, "/2.0.2/"

    invoke-virtual {v0, v1}, Ljava/lang/String;->endsWith(Ljava/lang/String;)Z

    move-result v1

    if-eqz v1, :cond_1

    .line 325
    const/16 v1, 0x4e22

    iput v1, p0, Lorg/microemu/device/impl/DeviceImpl;->skinVersion:I

    goto :goto_0

    .line 327
    :cond_1
    iput v2, p0, Lorg/microemu/device/impl/DeviceImpl;->skinVersion:I

    goto :goto_0
.end method

.method private static loadXmlDocument(Ljava/io/InputStream;)Lnanoxml/XMLElement;
    .locals 4
    .parameter "descriptor"
    .annotation system Ldalvik/annotation/Throws;
        value = {
            Ljava/io/IOException;
        }
    .end annotation

    .prologue
    .line 788
    new-instance v0, Lnanoxml/XMLElement;

    invoke-direct {v0}, Lnanoxml/XMLElement;-><init>()V

    .line 790
    .local v0, doc:Lnanoxml/XMLElement;
    const/4 v2, 0x1

    :try_start_0
    invoke-virtual {v0, p0, v2}, Lnanoxml/XMLElement;->parse(Ljava/io/InputStream;I)V
    :try_end_0
    .catch Lnanoxml/XMLParseException; {:try_start_0 .. :try_end_0} :catch_0

    .line 794
    return-object v0

    .line 791
    :catch_0
    move-exception v1

    .line 792
    .local v1, ex:Lnanoxml/XMLParseException;
    new-instance v2, Ljava/io/IOException;

    invoke-virtual {v1}, Lnanoxml/XMLParseException;->toString()Ljava/lang/String;

    move-result-object v3

    invoke-direct {v2, v3}, Ljava/io/IOException;-><init>(Ljava/lang/String;)V

    throw v2
.end method

.method private parseBoolean(Ljava/lang/String;)Z
    .locals 3
    .parameter "value"

    .prologue
    .line 636
    invoke-virtual {p1}, Ljava/lang/String;->toLowerCase()Ljava/lang/String;

    move-result-object v0

    new-instance v1, Ljava/lang/String;

    const-string v2, "true"

    invoke-direct {v1, v2}, Ljava/lang/String;-><init>(Ljava/lang/String;)V

    invoke-virtual {v1}, Ljava/lang/String;->toLowerCase()Ljava/lang/String;

    move-result-object v1

    invoke-virtual {v0, v1}, Ljava/lang/String;->equals(Ljava/lang/Object;)Z

    move-result v0

    if-eqz v0, :cond_0

    .line 637
    const/4 v0, 0x1

    .line 639
    :goto_0
    return v0

    :cond_0
    const/4 v0, 0x0

    goto :goto_0
.end method

.method private parseDisplay(Ljava/lang/ClassLoader;Ljava/lang/String;Lnanoxml/XMLElement;)V
    .locals 20
    .parameter "classLoader"
    .parameter "base"
    .parameter "tmp"
    .annotation system Ldalvik/annotation/Throws;
        value = {
            Ljava/io/IOException;
        }
    .end annotation

    .prologue
    .line 333
    invoke-virtual/range {p0 .. p0}, Lorg/microemu/device/impl/DeviceImpl;->getDeviceDisplay()Lorg/microemu/device/DeviceDisplay;

    move-result-object v4

    check-cast v4, Lorg/microemu/device/impl/DeviceDisplayImpl;

    .line 335
    .local v4, deviceDisplay:Lorg/microemu/device/impl/DeviceDisplayImpl;
    const-string v5, "resizable"

    const-string v6, "false"

    move-object/from16 v0, p3

    move-object v1, v5

    move-object v2, v6

    invoke-virtual {v0, v1, v2}, Lnanoxml/XMLElement;->getStringAttribute(Ljava/lang/String;Ljava/lang/String;)Ljava/lang/String;

    move-result-object v16

    .line 336
    .local v16, resizable:Ljava/lang/String;
    const-string v5, "true"

    move-object/from16 v0, v16

    move-object v1, v5

    invoke-virtual {v0, v1}, Ljava/lang/String;->equalsIgnoreCase(Ljava/lang/String;)Z

    move-result v5

    if-eqz v5, :cond_1

    .line 337
    const/4 v5, 0x1

    invoke-interface {v4, v5}, Lorg/microemu/device/impl/DeviceDisplayImpl;->setResizable(Z)V

    .line 342
    :goto_0
    invoke-virtual/range {p3 .. p3}, Lnanoxml/XMLElement;->enumerateChildren()Ljava/util/Enumeration;

    move-result-object v10

    .local v10, e_display:Ljava/util/Enumeration;
    :cond_0
    :goto_1
    invoke-interface {v10}, Ljava/util/Enumeration;->hasMoreElements()Z

    move-result v5

    if-eqz v5, :cond_9

    .line 343
    invoke-interface {v10}, Ljava/util/Enumeration;->nextElement()Ljava/lang/Object;

    move-result-object v17

    check-cast v17, Lnanoxml/XMLElement;

    .line 344
    .local v17, tmp_display:Lnanoxml/XMLElement;
    invoke-virtual/range {v17 .. v17}, Lnanoxml/XMLElement;->getName()Ljava/lang/String;

    move-result-object v5

    const-string v6, "numcolors"

    invoke-virtual {v5, v6}, Ljava/lang/String;->equals(Ljava/lang/Object;)Z

    move-result v5

    if-eqz v5, :cond_2

    .line 345
    invoke-virtual/range {v17 .. v17}, Lnanoxml/XMLElement;->getContent()Ljava/lang/String;

    move-result-object v5

    invoke-static {v5}, Ljava/lang/Integer;->parseInt(Ljava/lang/String;)I

    move-result v5

    invoke-interface {v4, v5}, Lorg/microemu/device/impl/DeviceDisplayImpl;->setNumColors(I)V

    goto :goto_1

    .line 339
    .end local v10           #e_display:Ljava/util/Enumeration;
    .end local v17           #tmp_display:Lnanoxml/XMLElement;
    :cond_1
    const/4 v5, 0x0

    invoke-interface {v4, v5}, Lorg/microemu/device/impl/DeviceDisplayImpl;->setResizable(Z)V

    goto :goto_0

    .line 346
    .restart local v10       #e_display:Ljava/util/Enumeration;
    .restart local v17       #tmp_display:Lnanoxml/XMLElement;
    :cond_2
    invoke-virtual/range {v17 .. v17}, Lnanoxml/XMLElement;->getName()Ljava/lang/String;

    move-result-object v5

    const-string v6, "iscolor"

    invoke-virtual {v5, v6}, Ljava/lang/String;->equals(Ljava/lang/Object;)Z

    move-result v5

    if-eqz v5, :cond_3

    .line 347
    invoke-virtual/range {v17 .. v17}, Lnanoxml/XMLElement;->getContent()Ljava/lang/String;

    move-result-object v5

    move-object/from16 v0, p0

    move-object v1, v5

    invoke-direct {v0, v1}, Lorg/microemu/device/impl/DeviceImpl;->parseBoolean(Ljava/lang/String;)Z

    move-result v5

    invoke-interface {v4, v5}, Lorg/microemu/device/impl/DeviceDisplayImpl;->setIsColor(Z)V

    goto :goto_1

    .line 348
    :cond_3
    invoke-virtual/range {v17 .. v17}, Lnanoxml/XMLElement;->getName()Ljava/lang/String;

    move-result-object v5

    const-string v6, "numalphalevels"

    invoke-virtual {v5, v6}, Ljava/lang/String;->equals(Ljava/lang/Object;)Z

    move-result v5

    if-eqz v5, :cond_4

    .line 349
    invoke-virtual/range {v17 .. v17}, Lnanoxml/XMLElement;->getContent()Ljava/lang/String;

    move-result-object v5

    invoke-static {v5}, Ljava/lang/Integer;->parseInt(Ljava/lang/String;)I

    move-result v5

    invoke-interface {v4, v5}, Lorg/microemu/device/impl/DeviceDisplayImpl;->setNumAlphaLevels(I)V

    goto :goto_1

    .line 350
    :cond_4
    invoke-virtual/range {v17 .. v17}, Lnanoxml/XMLElement;->getName()Ljava/lang/String;

    move-result-object v5

    const-string v6, "background"

    invoke-virtual {v5, v6}, Ljava/lang/String;->equals(Ljava/lang/Object;)Z

    move-result v5

    if-eqz v5, :cond_5

    .line 351
    new-instance v5, Lorg/microemu/device/impl/Color;

    invoke-virtual/range {v17 .. v17}, Lnanoxml/XMLElement;->getContent()Ljava/lang/String;

    move-result-object v6

    const/16 v7, 0x10

    invoke-static {v6, v7}, Ljava/lang/Integer;->parseInt(Ljava/lang/String;I)I

    move-result v6

    invoke-direct {v5, v6}, Lorg/microemu/device/impl/Color;-><init>(I)V

    invoke-interface {v4, v5}, Lorg/microemu/device/impl/DeviceDisplayImpl;->setBackgroundColor(Lorg/microemu/device/impl/Color;)V

    goto :goto_1

    .line 352
    :cond_5
    invoke-virtual/range {v17 .. v17}, Lnanoxml/XMLElement;->getName()Ljava/lang/String;

    move-result-object v5

    const-string v6, "foreground"

    invoke-virtual {v5, v6}, Ljava/lang/String;->equals(Ljava/lang/Object;)Z

    move-result v5

    if-eqz v5, :cond_6

    .line 353
    new-instance v5, Lorg/microemu/device/impl/Color;

    invoke-virtual/range {v17 .. v17}, Lnanoxml/XMLElement;->getContent()Ljava/lang/String;

    move-result-object v6

    const/16 v7, 0x10

    invoke-static {v6, v7}, Ljava/lang/Integer;->parseInt(Ljava/lang/String;I)I

    move-result v6

    invoke-direct {v5, v6}, Lorg/microemu/device/impl/Color;-><init>(I)V

    invoke-interface {v4, v5}, Lorg/microemu/device/impl/DeviceDisplayImpl;->setForegroundColor(Lorg/microemu/device/impl/Color;)V

    goto/16 :goto_1

    .line 354
    :cond_6
    invoke-virtual/range {v17 .. v17}, Lnanoxml/XMLElement;->getName()Ljava/lang/String;

    move-result-object v5

    const-string v6, "rectangle"

    invoke-virtual {v5, v6}, Ljava/lang/String;->equals(Ljava/lang/Object;)Z

    move-result v5

    if-eqz v5, :cond_8

    .line 355
    move-object/from16 v0, p0

    move-object/from16 v1, v17

    invoke-direct {v0, v1}, Lorg/microemu/device/impl/DeviceImpl;->getRectangle(Lnanoxml/XMLElement;)Lorg/microemu/device/impl/Rectangle;

    move-result-object v15

    .line 356
    .local v15, rect:Lorg/microemu/device/impl/Rectangle;
    invoke-interface {v4}, Lorg/microemu/device/impl/DeviceDisplayImpl;->isResizable()Z

    move-result v5

    if-eqz v5, :cond_7

    .line 357
    const/4 v5, 0x0

    iput v5, v15, Lorg/microemu/device/impl/Rectangle;->x:I

    .line 358
    const/4 v5, 0x0

    iput v5, v15, Lorg/microemu/device/impl/Rectangle;->y:I

    .line 360
    :cond_7
    invoke-interface {v4, v15}, Lorg/microemu/device/impl/DeviceDisplayImpl;->setDisplayRectangle(Lorg/microemu/device/impl/Rectangle;)V

    goto/16 :goto_1

    .line 361
    .end local v15           #rect:Lorg/microemu/device/impl/Rectangle;
    :cond_8
    invoke-virtual/range {v17 .. v17}, Lnanoxml/XMLElement;->getName()Ljava/lang/String;

    move-result-object v5

    const-string v6, "paintable"

    invoke-virtual {v5, v6}, Ljava/lang/String;->equals(Ljava/lang/Object;)Z

    move-result v5

    if-eqz v5, :cond_0

    .line 362
    move-object/from16 v0, p0

    move-object/from16 v1, v17

    invoke-direct {v0, v1}, Lorg/microemu/device/impl/DeviceImpl;->getRectangle(Lnanoxml/XMLElement;)Lorg/microemu/device/impl/Rectangle;

    move-result-object v5

    invoke-interface {v4, v5}, Lorg/microemu/device/impl/DeviceDisplayImpl;->setDisplayPaintable(Lorg/microemu/device/impl/Rectangle;)V

    goto/16 :goto_1

    .line 365
    .end local v17           #tmp_display:Lnanoxml/XMLElement;
    :cond_9
    invoke-virtual/range {p3 .. p3}, Lnanoxml/XMLElement;->enumerateChildren()Ljava/util/Enumeration;

    move-result-object v10

    .restart local v10       #e_display:Ljava/util/Enumeration;
    :cond_a
    :goto_2
    invoke-interface {v10}, Ljava/util/Enumeration;->hasMoreElements()Z

    move-result v5

    if-eqz v5, :cond_17

    .line 366
    invoke-interface {v10}, Ljava/util/Enumeration;->nextElement()Ljava/lang/Object;

    move-result-object v17

    check-cast v17, Lnanoxml/XMLElement;

    .line 367
    .restart local v17       #tmp_display:Lnanoxml/XMLElement;
    invoke-virtual/range {v17 .. v17}, Lnanoxml/XMLElement;->getName()Ljava/lang/String;

    move-result-object v5

    const-string v6, "img"

    invoke-virtual {v5, v6}, Ljava/lang/String;->equals(Ljava/lang/Object;)Z

    move-result v5

    if-eqz v5, :cond_f

    .line 368
    const-string v5, "name"

    move-object/from16 v0, v17

    move-object v1, v5

    invoke-virtual {v0, v1}, Lnanoxml/XMLElement;->getStringAttribute(Ljava/lang/String;)Ljava/lang/String;

    move-result-object v5

    const-string v6, "up"

    invoke-virtual {v5, v6}, Ljava/lang/String;->equals(Ljava/lang/Object;)Z

    move-result v5

    if-nez v5, :cond_b

    const-string v5, "name"

    move-object/from16 v0, v17

    move-object v1, v5

    invoke-virtual {v0, v1}, Lnanoxml/XMLElement;->getStringAttribute(Ljava/lang/String;)Ljava/lang/String;

    move-result-object v5

    const-string v6, "down"

    invoke-virtual {v5, v6}, Ljava/lang/String;->equals(Ljava/lang/Object;)Z

    move-result v5

    if-eqz v5, :cond_c

    .line 371
    :cond_b
    move-object/from16 v0, p0

    iget v0, v0, Lorg/microemu/device/impl/DeviceImpl;->skinVersion:I

    move v5, v0

    const-string v6, "name"

    move-object/from16 v0, v17

    move-object v1, v6

    invoke-virtual {v0, v1}, Lnanoxml/XMLElement;->getStringAttribute(Ljava/lang/String;)Ljava/lang/String;

    move-result-object v6

    const-string v7, "paintable"

    move-object/from16 v0, v17

    move-object v1, v7

    invoke-virtual {v0, v1}, Lnanoxml/XMLElement;->getChild(Ljava/lang/String;)Lnanoxml/XMLElement;

    move-result-object v7

    move-object/from16 v0, p0

    move-object v1, v7

    invoke-direct {v0, v1}, Lorg/microemu/device/impl/DeviceImpl;->getRectangle(Lnanoxml/XMLElement;)Lorg/microemu/device/impl/Rectangle;

    move-result-object v7

    const-string v8, "src"

    move-object/from16 v0, v17

    move-object v1, v8

    invoke-virtual {v0, v1}, Lnanoxml/XMLElement;->getStringAttribute(Ljava/lang/String;)Ljava/lang/String;

    move-result-object v8

    move-object/from16 v0, p0

    move-object/from16 v1, p1

    move-object/from16 v2, p2

    move-object v3, v8

    invoke-direct {v0, v1, v2, v3}, Lorg/microemu/device/impl/DeviceImpl;->loadImage(Ljava/lang/ClassLoader;Ljava/lang/String;Ljava/lang/String;)Ljavax/microedition/lcdui/Image;

    move-result-object v8

    const-string v9, "src"

    move-object/from16 v0, v17

    move-object v1, v9

    invoke-virtual {v0, v1}, Lnanoxml/XMLElement;->getStringAttribute(Ljava/lang/String;)Ljava/lang/String;

    move-result-object v9

    move-object/from16 v0, p0

    move-object/from16 v1, p1

    move-object/from16 v2, p2

    move-object v3, v9

    invoke-direct {v0, v1, v2, v3}, Lorg/microemu/device/impl/DeviceImpl;->loadImage(Ljava/lang/ClassLoader;Ljava/lang/String;Ljava/lang/String;)Ljavax/microedition/lcdui/Image;

    move-result-object v9

    invoke-interface/range {v4 .. v9}, Lorg/microemu/device/impl/DeviceDisplayImpl;->createSoftButton(ILjava/lang/String;Lorg/microemu/device/impl/Rectangle;Ljavax/microedition/lcdui/Image;Ljavax/microedition/lcdui/Image;)Lorg/microemu/device/impl/SoftButton;

    move-result-object v13

    .line 375
    .local v13, icon:Lorg/microemu/device/impl/SoftButton;
    invoke-virtual/range {p0 .. p0}, Lorg/microemu/device/impl/DeviceImpl;->getSoftButtons()Ljava/util/Vector;

    move-result-object v5

    invoke-virtual {v5, v13}, Ljava/util/Vector;->addElement(Ljava/lang/Object;)V

    goto/16 :goto_2

    .line 376
    .end local v13           #icon:Lorg/microemu/device/impl/SoftButton;
    :cond_c
    const-string v5, "name"

    move-object/from16 v0, v17

    move-object v1, v5

    invoke-virtual {v0, v1}, Lnanoxml/XMLElement;->getStringAttribute(Ljava/lang/String;)Ljava/lang/String;

    move-result-object v5

    const-string v6, "mode"

    invoke-virtual {v5, v6}, Ljava/lang/String;->equals(Ljava/lang/Object;)Z

    move-result v5

    if-eqz v5, :cond_a

    .line 378
    const-string v5, "type"

    move-object/from16 v0, v17

    move-object v1, v5

    invoke-virtual {v0, v1}, Lnanoxml/XMLElement;->getStringAttribute(Ljava/lang/String;)Ljava/lang/String;

    move-result-object v5

    const-string v6, "123"

    invoke-virtual {v5, v6}, Ljava/lang/String;->equals(Ljava/lang/Object;)Z

    move-result v5

    if-eqz v5, :cond_d

    .line 379
    new-instance v5, Lorg/microemu/device/impl/PositionedImage;

    const-string v6, "src"

    move-object/from16 v0, v17

    move-object v1, v6

    invoke-virtual {v0, v1}, Lnanoxml/XMLElement;->getStringAttribute(Ljava/lang/String;)Ljava/lang/String;

    move-result-object v6

    move-object/from16 v0, p0

    move-object/from16 v1, p1

    move-object/from16 v2, p2

    move-object v3, v6

    invoke-direct {v0, v1, v2, v3}, Lorg/microemu/device/impl/DeviceImpl;->loadImage(Ljava/lang/ClassLoader;Ljava/lang/String;Ljava/lang/String;)Ljavax/microedition/lcdui/Image;

    move-result-object v6

    const-string v7, "paintable"

    move-object/from16 v0, v17

    move-object v1, v7

    invoke-virtual {v0, v1}, Lnanoxml/XMLElement;->getChild(Ljava/lang/String;)Lnanoxml/XMLElement;

    move-result-object v7

    move-object/from16 v0, p0

    move-object v1, v7

    invoke-direct {v0, v1}, Lorg/microemu/device/impl/DeviceImpl;->getRectangle(Lnanoxml/XMLElement;)Lorg/microemu/device/impl/Rectangle;

    move-result-object v7

    invoke-direct {v5, v6, v7}, Lorg/microemu/device/impl/PositionedImage;-><init>(Ljavax/microedition/lcdui/Image;Lorg/microemu/device/impl/Rectangle;)V

    invoke-interface {v4, v5}, Lorg/microemu/device/impl/DeviceDisplayImpl;->setMode123Image(Lorg/microemu/device/impl/PositionedImage;)V

    goto/16 :goto_2

    .line 381
    :cond_d
    const-string v5, "type"

    move-object/from16 v0, v17

    move-object v1, v5

    invoke-virtual {v0, v1}, Lnanoxml/XMLElement;->getStringAttribute(Ljava/lang/String;)Ljava/lang/String;

    move-result-object v5

    const-string v6, "abc"

    invoke-virtual {v5, v6}, Ljava/lang/String;->equals(Ljava/lang/Object;)Z

    move-result v5

    if-eqz v5, :cond_e

    .line 382
    new-instance v5, Lorg/microemu/device/impl/PositionedImage;

    const-string v6, "src"

    move-object/from16 v0, v17

    move-object v1, v6

    invoke-virtual {v0, v1}, Lnanoxml/XMLElement;->getStringAttribute(Ljava/lang/String;)Ljava/lang/String;

    move-result-object v6

    move-object/from16 v0, p0

    move-object/from16 v1, p1

    move-object/from16 v2, p2

    move-object v3, v6

    invoke-direct {v0, v1, v2, v3}, Lorg/microemu/device/impl/DeviceImpl;->loadImage(Ljava/lang/ClassLoader;Ljava/lang/String;Ljava/lang/String;)Ljavax/microedition/lcdui/Image;

    move-result-object v6

    const-string v7, "paintable"

    move-object/from16 v0, v17

    move-object v1, v7

    invoke-virtual {v0, v1}, Lnanoxml/XMLElement;->getChild(Ljava/lang/String;)Lnanoxml/XMLElement;

    move-result-object v7

    move-object/from16 v0, p0

    move-object v1, v7

    invoke-direct {v0, v1}, Lorg/microemu/device/impl/DeviceImpl;->getRectangle(Lnanoxml/XMLElement;)Lorg/microemu/device/impl/Rectangle;

    move-result-object v7

    invoke-direct {v5, v6, v7}, Lorg/microemu/device/impl/PositionedImage;-><init>(Ljavax/microedition/lcdui/Image;Lorg/microemu/device/impl/Rectangle;)V

    invoke-interface {v4, v5}, Lorg/microemu/device/impl/DeviceDisplayImpl;->setModeAbcLowerImage(Lorg/microemu/device/impl/PositionedImage;)V

    goto/16 :goto_2

    .line 384
    :cond_e
    const-string v5, "type"

    move-object/from16 v0, v17

    move-object v1, v5

    invoke-virtual {v0, v1}, Lnanoxml/XMLElement;->getStringAttribute(Ljava/lang/String;)Ljava/lang/String;

    move-result-object v5

    const-string v6, "ABC"

    invoke-virtual {v5, v6}, Ljava/lang/String;->equals(Ljava/lang/Object;)Z

    move-result v5

    if-eqz v5, :cond_a

    .line 385
    new-instance v5, Lorg/microemu/device/impl/PositionedImage;

    const-string v6, "src"

    move-object/from16 v0, v17

    move-object v1, v6

    invoke-virtual {v0, v1}, Lnanoxml/XMLElement;->getStringAttribute(Ljava/lang/String;)Ljava/lang/String;

    move-result-object v6

    move-object/from16 v0, p0

    move-object/from16 v1, p1

    move-object/from16 v2, p2

    move-object v3, v6

    invoke-direct {v0, v1, v2, v3}, Lorg/microemu/device/impl/DeviceImpl;->loadImage(Ljava/lang/ClassLoader;Ljava/lang/String;Ljava/lang/String;)Ljavax/microedition/lcdui/Image;

    move-result-object v6

    const-string v7, "paintable"

    move-object/from16 v0, v17

    move-object v1, v7

    invoke-virtual {v0, v1}, Lnanoxml/XMLElement;->getChild(Ljava/lang/String;)Lnanoxml/XMLElement;

    move-result-object v7

    move-object/from16 v0, p0

    move-object v1, v7

    invoke-direct {v0, v1}, Lorg/microemu/device/impl/DeviceImpl;->getRectangle(Lnanoxml/XMLElement;)Lorg/microemu/device/impl/Rectangle;

    move-result-object v7

    invoke-direct {v5, v6, v7}, Lorg/microemu/device/impl/PositionedImage;-><init>(Ljavax/microedition/lcdui/Image;Lorg/microemu/device/impl/Rectangle;)V

    invoke-interface {v4, v5}, Lorg/microemu/device/impl/DeviceDisplayImpl;->setModeAbcUpperImage(Lorg/microemu/device/impl/PositionedImage;)V

    goto/16 :goto_2

    .line 389
    :cond_f
    invoke-virtual/range {v17 .. v17}, Lnanoxml/XMLElement;->getName()Ljava/lang/String;

    move-result-object v5

    const-string v6, "icon"

    invoke-virtual {v5, v6}, Ljava/lang/String;->equals(Ljava/lang/Object;)Z

    move-result v5

    if-eqz v5, :cond_13

    .line 390
    const/4 v8, 0x0

    .line 391
    .local v8, iconNormalImage:Ljavax/microedition/lcdui/Image;
    const/4 v9, 0x0

    .line 392
    .local v9, iconPressedImage:Ljavax/microedition/lcdui/Image;
    invoke-virtual/range {v17 .. v17}, Lnanoxml/XMLElement;->enumerateChildren()Ljava/util/Enumeration;

    move-result-object v11

    .local v11, e_icon:Ljava/util/Enumeration;
    :cond_10
    :goto_3
    invoke-interface {v11}, Ljava/util/Enumeration;->hasMoreElements()Z

    move-result v5

    if-eqz v5, :cond_12

    .line 393
    invoke-interface {v11}, Ljava/util/Enumeration;->nextElement()Ljava/lang/Object;

    move-result-object v18

    check-cast v18, Lnanoxml/XMLElement;

    .line 394
    .local v18, tmp_icon:Lnanoxml/XMLElement;
    invoke-virtual/range {v18 .. v18}, Lnanoxml/XMLElement;->getName()Ljava/lang/String;

    move-result-object v5

    const-string v6, "img"

    invoke-virtual {v5, v6}, Ljava/lang/String;->equals(Ljava/lang/Object;)Z

    move-result v5

    if-eqz v5, :cond_10

    .line 395
    const-string v5, "name"

    move-object/from16 v0, v18

    move-object v1, v5

    invoke-virtual {v0, v1}, Lnanoxml/XMLElement;->getStringAttribute(Ljava/lang/String;)Ljava/lang/String;

    move-result-object v5

    const-string v6, "normal"

    invoke-virtual {v5, v6}, Ljava/lang/String;->equals(Ljava/lang/Object;)Z

    move-result v5

    if-eqz v5, :cond_11

    .line 396
    const-string v5, "src"

    move-object/from16 v0, v18

    move-object v1, v5

    invoke-virtual {v0, v1}, Lnanoxml/XMLElement;->getStringAttribute(Ljava/lang/String;)Ljava/lang/String;

    move-result-object v5

    move-object/from16 v0, p0

    move-object/from16 v1, p1

    move-object/from16 v2, p2

    move-object v3, v5

    invoke-direct {v0, v1, v2, v3}, Lorg/microemu/device/impl/DeviceImpl;->loadImage(Ljava/lang/ClassLoader;Ljava/lang/String;Ljava/lang/String;)Ljavax/microedition/lcdui/Image;

    move-result-object v8

    goto :goto_3

    .line 397
    :cond_11
    const-string v5, "name"

    move-object/from16 v0, v18

    move-object v1, v5

    invoke-virtual {v0, v1}, Lnanoxml/XMLElement;->getStringAttribute(Ljava/lang/String;)Ljava/lang/String;

    move-result-object v5

    const-string v6, "pressed"

    invoke-virtual {v5, v6}, Ljava/lang/String;->equals(Ljava/lang/Object;)Z

    move-result v5

    if-eqz v5, :cond_10

    .line 398
    const-string v5, "src"

    move-object/from16 v0, v18

    move-object v1, v5

    invoke-virtual {v0, v1}, Lnanoxml/XMLElement;->getStringAttribute(Ljava/lang/String;)Ljava/lang/String;

    move-result-object v5

    move-object/from16 v0, p0

    move-object/from16 v1, p1

    move-object/from16 v2, p2

    move-object v3, v5

    invoke-direct {v0, v1, v2, v3}, Lorg/microemu/device/impl/DeviceImpl;->loadImage(Ljava/lang/ClassLoader;Ljava/lang/String;Ljava/lang/String;)Ljavax/microedition/lcdui/Image;

    move-result-object v9

    goto :goto_3

    .line 402
    .end local v18           #tmp_icon:Lnanoxml/XMLElement;
    :cond_12
    move-object/from16 v0, p0

    iget v0, v0, Lorg/microemu/device/impl/DeviceImpl;->skinVersion:I

    move v5, v0

    const-string v6, "name"

    move-object/from16 v0, v17

    move-object v1, v6

    invoke-virtual {v0, v1}, Lnanoxml/XMLElement;->getStringAttribute(Ljava/lang/String;)Ljava/lang/String;

    move-result-object v6

    const-string v7, "paintable"

    move-object/from16 v0, v17

    move-object v1, v7

    invoke-virtual {v0, v1}, Lnanoxml/XMLElement;->getChild(Ljava/lang/String;)Lnanoxml/XMLElement;

    move-result-object v7

    move-object/from16 v0, p0

    move-object v1, v7

    invoke-direct {v0, v1}, Lorg/microemu/device/impl/DeviceImpl;->getRectangle(Lnanoxml/XMLElement;)Lorg/microemu/device/impl/Rectangle;

    move-result-object v7

    invoke-interface/range {v4 .. v9}, Lorg/microemu/device/impl/DeviceDisplayImpl;->createSoftButton(ILjava/lang/String;Lorg/microemu/device/impl/Rectangle;Ljavax/microedition/lcdui/Image;Ljavax/microedition/lcdui/Image;)Lorg/microemu/device/impl/SoftButton;

    move-result-object v13

    .line 404
    .restart local v13       #icon:Lorg/microemu/device/impl/SoftButton;
    invoke-virtual/range {p0 .. p0}, Lorg/microemu/device/impl/DeviceImpl;->getSoftButtons()Ljava/util/Vector;

    move-result-object v5

    invoke-virtual {v5, v13}, Ljava/util/Vector;->addElement(Ljava/lang/Object;)V

    goto/16 :goto_2

    .line 405
    .end local v11           #e_icon:Ljava/util/Enumeration;
    .end local v8           #iconNormalImage:Ljavax/microedition/lcdui/Image;
    .end local v9           #iconPressedImage:Ljavax/microedition/lcdui/Image;
    .end local v13           #icon:Lorg/microemu/device/impl/SoftButton;
    :cond_13
    invoke-virtual/range {v17 .. v17}, Lnanoxml/XMLElement;->getName()Ljava/lang/String;

    move-result-object v5

    const-string v6, "status"

    invoke-virtual {v5, v6}, Ljava/lang/String;->equals(Ljava/lang/Object;)Z

    move-result v5

    if-eqz v5, :cond_a

    .line 406
    const-string v5, "name"

    move-object/from16 v0, v17

    move-object v1, v5

    invoke-virtual {v0, v1}, Lnanoxml/XMLElement;->getStringAttribute(Ljava/lang/String;)Ljava/lang/String;

    move-result-object v5

    const-string v6, "input"

    invoke-virtual {v5, v6}, Ljava/lang/String;->equals(Ljava/lang/Object;)Z

    move-result v5

    if-eqz v5, :cond_a

    .line 407
    const-string v5, "paintable"

    move-object/from16 v0, v17

    move-object v1, v5

    invoke-virtual {v0, v1}, Lnanoxml/XMLElement;->getChild(Ljava/lang/String;)Lnanoxml/XMLElement;

    move-result-object v5

    move-object/from16 v0, p0

    move-object v1, v5

    invoke-direct {v0, v1}, Lorg/microemu/device/impl/DeviceImpl;->getRectangle(Lnanoxml/XMLElement;)Lorg/microemu/device/impl/Rectangle;

    move-result-object v14

    .line 408
    .local v14, paintable:Lorg/microemu/device/impl/Rectangle;
    invoke-virtual/range {v17 .. v17}, Lnanoxml/XMLElement;->enumerateChildren()Ljava/util/Enumeration;

    move-result-object v12

    .local v12, e_status:Ljava/util/Enumeration;
    :cond_14
    :goto_4
    invoke-interface {v12}, Ljava/util/Enumeration;->hasMoreElements()Z

    move-result v5

    if-eqz v5, :cond_a

    .line 409
    invoke-interface {v12}, Ljava/util/Enumeration;->nextElement()Ljava/lang/Object;

    move-result-object v19

    check-cast v19, Lnanoxml/XMLElement;

    .line 410
    .local v19, tmp_status:Lnanoxml/XMLElement;
    invoke-virtual/range {v19 .. v19}, Lnanoxml/XMLElement;->getName()Ljava/lang/String;

    move-result-object v5

    const-string v6, "img"

    invoke-virtual {v5, v6}, Ljava/lang/String;->equals(Ljava/lang/Object;)Z

    move-result v5

    if-eqz v5, :cond_14

    .line 411
    const-string v5, "name"

    move-object/from16 v0, v19

    move-object v1, v5

    invoke-virtual {v0, v1}, Lnanoxml/XMLElement;->getStringAttribute(Ljava/lang/String;)Ljava/lang/String;

    move-result-object v5

    const-string v6, "123"

    invoke-virtual {v5, v6}, Ljava/lang/String;->equals(Ljava/lang/Object;)Z

    move-result v5

    if-eqz v5, :cond_15

    .line 412
    new-instance v5, Lorg/microemu/device/impl/PositionedImage;

    const-string v6, "src"

    move-object/from16 v0, v19

    move-object v1, v6

    invoke-virtual {v0, v1}, Lnanoxml/XMLElement;->getStringAttribute(Ljava/lang/String;)Ljava/lang/String;

    move-result-object v6

    move-object/from16 v0, p0

    move-object/from16 v1, p1

    move-object/from16 v2, p2

    move-object v3, v6

    invoke-direct {v0, v1, v2, v3}, Lorg/microemu/device/impl/DeviceImpl;->loadImage(Ljava/lang/ClassLoader;Ljava/lang/String;Ljava/lang/String;)Ljavax/microedition/lcdui/Image;

    move-result-object v6

    invoke-direct {v5, v6, v14}, Lorg/microemu/device/impl/PositionedImage;-><init>(Ljavax/microedition/lcdui/Image;Lorg/microemu/device/impl/Rectangle;)V

    invoke-interface {v4, v5}, Lorg/microemu/device/impl/DeviceDisplayImpl;->setMode123Image(Lorg/microemu/device/impl/PositionedImage;)V

    goto :goto_4

    .line 414
    :cond_15
    const-string v5, "name"

    move-object/from16 v0, v19

    move-object v1, v5

    invoke-virtual {v0, v1}, Lnanoxml/XMLElement;->getStringAttribute(Ljava/lang/String;)Ljava/lang/String;

    move-result-object v5

    const-string v6, "abc"

    invoke-virtual {v5, v6}, Ljava/lang/String;->equals(Ljava/lang/Object;)Z

    move-result v5

    if-eqz v5, :cond_16

    .line 415
    new-instance v5, Lorg/microemu/device/impl/PositionedImage;

    const-string v6, "src"

    move-object/from16 v0, v19

    move-object v1, v6

    invoke-virtual {v0, v1}, Lnanoxml/XMLElement;->getStringAttribute(Ljava/lang/String;)Ljava/lang/String;

    move-result-object v6

    move-object/from16 v0, p0

    move-object/from16 v1, p1

    move-object/from16 v2, p2

    move-object v3, v6

    invoke-direct {v0, v1, v2, v3}, Lorg/microemu/device/impl/DeviceImpl;->loadImage(Ljava/lang/ClassLoader;Ljava/lang/String;Ljava/lang/String;)Ljavax/microedition/lcdui/Image;

    move-result-object v6

    invoke-direct {v5, v6, v14}, Lorg/microemu/device/impl/PositionedImage;-><init>(Ljavax/microedition/lcdui/Image;Lorg/microemu/device/impl/Rectangle;)V

    invoke-interface {v4, v5}, Lorg/microemu/device/impl/DeviceDisplayImpl;->setModeAbcLowerImage(Lorg/microemu/device/impl/PositionedImage;)V

    goto :goto_4

    .line 417
    :cond_16
    const-string v5, "name"

    move-object/from16 v0, v19

    move-object v1, v5

    invoke-virtual {v0, v1}, Lnanoxml/XMLElement;->getStringAttribute(Ljava/lang/String;)Ljava/lang/String;

    move-result-object v5

    const-string v6, "ABC"

    invoke-virtual {v5, v6}, Ljava/lang/String;->equals(Ljava/lang/Object;)Z

    move-result v5

    if-eqz v5, :cond_14

    .line 418
    new-instance v5, Lorg/microemu/device/impl/PositionedImage;

    const-string v6, "src"

    move-object/from16 v0, v19

    move-object v1, v6

    invoke-virtual {v0, v1}, Lnanoxml/XMLElement;->getStringAttribute(Ljava/lang/String;)Ljava/lang/String;

    move-result-object v6

    move-object/from16 v0, p0

    move-object/from16 v1, p1

    move-object/from16 v2, p2

    move-object v3, v6

    invoke-direct {v0, v1, v2, v3}, Lorg/microemu/device/impl/DeviceImpl;->loadImage(Ljava/lang/ClassLoader;Ljava/lang/String;Ljava/lang/String;)Ljavax/microedition/lcdui/Image;

    move-result-object v6

    invoke-direct {v5, v6, v14}, Lorg/microemu/device/impl/PositionedImage;-><init>(Ljavax/microedition/lcdui/Image;Lorg/microemu/device/impl/Rectangle;)V

    invoke-interface {v4, v5}, Lorg/microemu/device/impl/DeviceDisplayImpl;->setModeAbcUpperImage(Lorg/microemu/device/impl/PositionedImage;)V

    goto/16 :goto_4

    .line 426
    .end local v17           #tmp_display:Lnanoxml/XMLElement;
    .end local v14           #paintable:Lorg/microemu/device/impl/Rectangle;
    .end local v12           #e_status:Ljava/util/Enumeration;
    .end local v19           #tmp_status:Lnanoxml/XMLElement;
    :cond_17
    return-void
.end method

.method private parseFonts(Ljava/lang/ClassLoader;Ljava/lang/String;Lnanoxml/XMLElement;)V
    .locals 21
    .parameter "classLoader"
    .parameter "base"
    .parameter "tmp"
    .annotation system Ldalvik/annotation/Throws;
        value = {
            Ljava/io/IOException;
        }
    .end annotation

    .prologue
    .line 429
    invoke-virtual/range {p0 .. p0}, Lorg/microemu/device/impl/DeviceImpl;->getFontManager()Lorg/microemu/device/FontManager;

    move-result-object v13

    check-cast v13, Lorg/microemu/device/impl/FontManagerImpl;

    .line 431
    .local v13, fontManager:Lorg/microemu/device/impl/FontManagerImpl;
    const-string v19, "hint"

    move-object/from16 v0, p3

    move-object/from16 v1, v19

    invoke-virtual {v0, v1}, Lnanoxml/XMLElement;->getStringAttribute(Ljava/lang/String;)Ljava/lang/String;

    move-result-object v14

    .line 432
    .local v14, hint:Ljava/lang/String;
    const/4 v5, 0x0

    .line 433
    .local v5, antialiasing:Z
    if-eqz v14, :cond_0

    const-string v19, "antialiasing"

    move-object v0, v14

    move-object/from16 v1, v19

    invoke-virtual {v0, v1}, Ljava/lang/String;->equals(Ljava/lang/Object;)Z

    move-result v19

    if-eqz v19, :cond_0

    .line 434
    const/4 v5, 0x1

    .line 436
    :cond_0
    invoke-interface {v13, v5}, Lorg/microemu/device/impl/FontManagerImpl;->setAntialiasing(Z)V

    .line 438
    invoke-virtual/range {p3 .. p3}, Lnanoxml/XMLElement;->enumerateChildren()Ljava/util/Enumeration;

    move-result-object v11

    .local v11, e_fonts:Ljava/util/Enumeration;
    :cond_1
    invoke-interface {v11}, Ljava/util/Enumeration;->hasMoreElements()Z

    move-result v19

    if-eqz v19, :cond_7

    .line 439
    invoke-interface {v11}, Ljava/util/Enumeration;->nextElement()Ljava/lang/Object;

    move-result-object v18

    check-cast v18, Lnanoxml/XMLElement;

    .line 440
    .local v18, tmp_font:Lnanoxml/XMLElement;
    invoke-virtual/range {v18 .. v18}, Lnanoxml/XMLElement;->getName()Ljava/lang/String;

    move-result-object v19

    const-string v20, "font"

    invoke-virtual/range {v19 .. v20}, Ljava/lang/String;->equals(Ljava/lang/Object;)Z

    move-result v19

    if-eqz v19, :cond_1

    .line 441
    const-string v19, "face"

    invoke-virtual/range {v18 .. v19}, Lnanoxml/XMLElement;->getStringAttribute(Ljava/lang/String;)Ljava/lang/String;

    move-result-object v19

    invoke-virtual/range {v19 .. v19}, Ljava/lang/String;->toLowerCase()Ljava/lang/String;

    move-result-object v12

    .line 442
    .local v12, face:Ljava/lang/String;
    const-string v19, "style"

    invoke-virtual/range {v18 .. v19}, Lnanoxml/XMLElement;->getStringAttribute(Ljava/lang/String;)Ljava/lang/String;

    move-result-object v19

    invoke-virtual/range {v19 .. v19}, Ljava/lang/String;->toLowerCase()Ljava/lang/String;

    move-result-object v16

    .line 443
    .local v16, style:Ljava/lang/String;
    const-string v19, "size"

    invoke-virtual/range {v18 .. v19}, Lnanoxml/XMLElement;->getStringAttribute(Ljava/lang/String;)Ljava/lang/String;

    move-result-object v19

    invoke-virtual/range {v19 .. v19}, Ljava/lang/String;->toLowerCase()Ljava/lang/String;

    move-result-object v15

    .line 445
    .local v15, size:Ljava/lang/String;
    const-string v19, "face_"

    move-object v0, v12

    move-object/from16 v1, v19

    invoke-virtual {v0, v1}, Ljava/lang/String;->startsWith(Ljava/lang/String;)Z

    move-result v19

    if-eqz v19, :cond_2

    .line 446
    const-string v19, "face_"

    invoke-virtual/range {v19 .. v19}, Ljava/lang/String;->length()I

    move-result v19

    move-object v0, v12

    move/from16 v1, v19

    invoke-virtual {v0, v1}, Ljava/lang/String;->substring(I)Ljava/lang/String;

    move-result-object v12

    .line 448
    :cond_2
    const-string v19, "style_"

    move-object/from16 v0, v16

    move-object/from16 v1, v19

    invoke-virtual {v0, v1}, Ljava/lang/String;->startsWith(Ljava/lang/String;)Z

    move-result v19

    if-eqz v19, :cond_3

    .line 449
    const-string v19, "style_"

    invoke-virtual/range {v19 .. v19}, Ljava/lang/String;->length()I

    move-result v19

    move-object/from16 v0, v16

    move/from16 v1, v19

    invoke-virtual {v0, v1}, Ljava/lang/String;->substring(I)Ljava/lang/String;

    move-result-object v16

    .line 451
    :cond_3
    const-string v19, "size_"

    move-object v0, v15

    move-object/from16 v1, v19

    invoke-virtual {v0, v1}, Ljava/lang/String;->startsWith(Ljava/lang/String;)Z

    move-result v19

    if-eqz v19, :cond_4

    .line 452
    const-string v19, "size_"

    invoke-virtual/range {v19 .. v19}, Ljava/lang/String;->length()I

    move-result v19

    move-object v0, v15

    move/from16 v1, v19

    invoke-virtual {v0, v1}, Ljava/lang/String;->substring(I)Ljava/lang/String;

    move-result-object v15

    .line 455
    :cond_4
    invoke-virtual/range {v18 .. v18}, Lnanoxml/XMLElement;->enumerateChildren()Ljava/util/Enumeration;

    move-result-object v10

    .local v10, e_defs:Ljava/util/Enumeration;
    :cond_5
    :goto_0
    invoke-interface {v10}, Ljava/util/Enumeration;->hasMoreElements()Z

    move-result v19

    if-eqz v19, :cond_1

    .line 456
    invoke-interface {v10}, Ljava/util/Enumeration;->nextElement()Ljava/lang/Object;

    move-result-object v17

    check-cast v17, Lnanoxml/XMLElement;

    .line 457
    .local v17, tmp_def:Lnanoxml/XMLElement;
    invoke-virtual/range {v17 .. v17}, Lnanoxml/XMLElement;->getName()Ljava/lang/String;

    move-result-object v19

    const-string v20, "system"

    invoke-virtual/range {v19 .. v20}, Ljava/lang/String;->equals(Ljava/lang/Object;)Z

    move-result v19

    if-eqz v19, :cond_6

    .line 458
    const-string v19, "name"

    move-object/from16 v0, v17

    move-object/from16 v1, v19

    invoke-virtual {v0, v1}, Lnanoxml/XMLElement;->getStringAttribute(Ljava/lang/String;)Ljava/lang/String;

    move-result-object v6

    .line 459
    .local v6, defName:Ljava/lang/String;
    const-string v19, "style"

    move-object/from16 v0, v17

    move-object/from16 v1, v19

    invoke-virtual {v0, v1}, Lnanoxml/XMLElement;->getStringAttribute(Ljava/lang/String;)Ljava/lang/String;

    move-result-object v9

    .line 460
    .local v9, defStyle:Ljava/lang/String;
    const-string v19, "size"

    move-object/from16 v0, v17

    move-object/from16 v1, v19

    invoke-virtual {v0, v1}, Lnanoxml/XMLElement;->getStringAttribute(Ljava/lang/String;)Ljava/lang/String;

    move-result-object v19

    invoke-static/range {v19 .. v19}, Ljava/lang/Integer;->parseInt(Ljava/lang/String;)I

    move-result v7

    .line 462
    .local v7, defSize:I
    invoke-interface {v13, v6, v9, v7, v5}, Lorg/microemu/device/impl/FontManagerImpl;->createSystemFont(Ljava/lang/String;Ljava/lang/String;IZ)Lorg/microemu/device/impl/Font;

    move-result-object v19

    move-object v0, v13

    move-object v1, v12

    move-object/from16 v2, v16

    move-object v3, v15

    move-object/from16 v4, v19

    invoke-interface {v0, v1, v2, v3, v4}, Lorg/microemu/device/impl/FontManagerImpl;->setFont(Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Lorg/microemu/device/impl/Font;)V

    goto :goto_0

    .line 464
    .end local v6           #defName:Ljava/lang/String;
    .end local v9           #defStyle:Ljava/lang/String;
    .end local v7           #defSize:I
    :cond_6
    invoke-virtual/range {v17 .. v17}, Lnanoxml/XMLElement;->getName()Ljava/lang/String;

    move-result-object v19

    const-string v20, "ttf"

    invoke-virtual/range {v19 .. v20}, Ljava/lang/String;->equals(Ljava/lang/Object;)Z

    move-result v19

    if-eqz v19, :cond_5

    .line 465
    const-string v19, "src"

    move-object/from16 v0, v17

    move-object/from16 v1, v19

    invoke-virtual {v0, v1}, Lnanoxml/XMLElement;->getStringAttribute(Ljava/lang/String;)Ljava/lang/String;

    move-result-object v8

    .line 466
    .local v8, defSrc:Ljava/lang/String;
    const-string v19, "style"

    move-object/from16 v0, v17

    move-object/from16 v1, v19

    invoke-virtual {v0, v1}, Lnanoxml/XMLElement;->getStringAttribute(Ljava/lang/String;)Ljava/lang/String;

    move-result-object v9

    .line 467
    .restart local v9       #defStyle:Ljava/lang/String;
    const-string v19, "size"

    move-object/from16 v0, v17

    move-object/from16 v1, v19

    invoke-virtual {v0, v1}, Lnanoxml/XMLElement;->getStringAttribute(Ljava/lang/String;)Ljava/lang/String;

    move-result-object v19

    invoke-static/range {v19 .. v19}, Ljava/lang/Integer;->parseInt(Ljava/lang/String;)I

    move-result v7

    .line 469
    .restart local v7       #defSize:I
    move-object/from16 v0, p0

    move-object/from16 v1, p1

    move-object/from16 v2, p2

    move-object v3, v8

    invoke-direct {v0, v1, v2, v3}, Lorg/microemu/device/impl/DeviceImpl;->getResourceUrl(Ljava/lang/ClassLoader;Ljava/lang/String;Ljava/lang/String;)Ljava/net/URL;

    move-result-object v19

    move-object v0, v13

    move-object/from16 v1, v19

    move-object v2, v9

    move v3, v7

    move v4, v5

    invoke-interface {v0, v1, v2, v3, v4}, Lorg/microemu/device/impl/FontManagerImpl;->createTrueTypeFont(Ljava/net/URL;Ljava/lang/String;IZ)Lorg/microemu/device/impl/Font;

    move-result-object v19

    move-object v0, v13

    move-object v1, v12

    move-object/from16 v2, v16

    move-object v3, v15

    move-object/from16 v4, v19

    invoke-interface {v0, v1, v2, v3, v4}, Lorg/microemu/device/impl/FontManagerImpl;->setFont(Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Lorg/microemu/device/impl/Font;)V

    goto/16 :goto_0

    .line 475
    .end local v18           #tmp_font:Lnanoxml/XMLElement;
    .end local v12           #face:Ljava/lang/String;
    .end local v16           #style:Ljava/lang/String;
    .end local v15           #size:Ljava/lang/String;
    .end local v10           #e_defs:Ljava/util/Enumeration;
    .end local v17           #tmp_def:Lnanoxml/XMLElement;
    .end local v8           #defSrc:Ljava/lang/String;
    .end local v9           #defStyle:Ljava/lang/String;
    .end local v7           #defSize:I
    :cond_7
    return-void
.end method

.method private parseInput(Lnanoxml/XMLElement;)V
    .locals 34
    .parameter "tmp"

    .prologue
    .line 478
    invoke-virtual/range {p0 .. p0}, Lorg/microemu/device/impl/DeviceImpl;->getDeviceDisplay()Lorg/microemu/device/DeviceDisplay;

    move-result-object v3

    check-cast v3, Lorg/microemu/device/impl/DeviceDisplayImpl;

    .line 479
    .local v3, deviceDisplay:Lorg/microemu/device/impl/DeviceDisplayImpl;
    invoke-interface {v3}, Lorg/microemu/device/impl/DeviceDisplayImpl;->isResizable()Z

    move-result v28

    .line 481
    .local v28, resizable:Z
    invoke-virtual/range {p1 .. p1}, Lnanoxml/XMLElement;->enumerateChildren()Ljava/util/Enumeration;

    move-result-object v25

    .local v25, e_keyboard:Ljava/util/Enumeration;
    :cond_0
    :goto_0
    invoke-interface/range {v25 .. v25}, Ljava/util/Enumeration;->hasMoreElements()Z

    move-result v4

    if-eqz v4, :cond_13

    .line 482
    invoke-interface/range {v25 .. v25}, Ljava/util/Enumeration;->nextElement()Ljava/lang/Object;

    move-result-object v33

    check-cast v33, Lnanoxml/XMLElement;

    .line 483
    .local v33, tmp_keyboard:Lnanoxml/XMLElement;
    invoke-virtual/range {v33 .. v33}, Lnanoxml/XMLElement;->getName()Ljava/lang/String;

    move-result-object v4

    const-string v5, "haspointerevents"

    invoke-virtual {v4, v5}, Ljava/lang/String;->equals(Ljava/lang/Object;)Z

    move-result v4

    if-eqz v4, :cond_1

    .line 484
    invoke-virtual/range {v33 .. v33}, Lnanoxml/XMLElement;->getContent()Ljava/lang/String;

    move-result-object v4

    move-object/from16 v0, p0

    move-object v1, v4

    invoke-direct {v0, v1}, Lorg/microemu/device/impl/DeviceImpl;->parseBoolean(Ljava/lang/String;)Z

    move-result v4

    move v0, v4

    move-object/from16 v1, p0

    iput-boolean v0, v1, Lorg/microemu/device/impl/DeviceImpl;->hasPointerEvents:Z

    goto :goto_0

    .line 485
    :cond_1
    invoke-virtual/range {v33 .. v33}, Lnanoxml/XMLElement;->getName()Ljava/lang/String;

    move-result-object v4

    const-string v5, "haspointermotionevents"

    invoke-virtual {v4, v5}, Ljava/lang/String;->equals(Ljava/lang/Object;)Z

    move-result v4

    if-eqz v4, :cond_2

    .line 486
    invoke-virtual/range {v33 .. v33}, Lnanoxml/XMLElement;->getContent()Ljava/lang/String;

    move-result-object v4

    move-object/from16 v0, p0

    move-object v1, v4

    invoke-direct {v0, v1}, Lorg/microemu/device/impl/DeviceImpl;->parseBoolean(Ljava/lang/String;)Z

    move-result v4

    move v0, v4

    move-object/from16 v1, p0

    iput-boolean v0, v1, Lorg/microemu/device/impl/DeviceImpl;->hasPointerMotionEvents:Z

    goto :goto_0

    .line 487
    :cond_2
    invoke-virtual/range {v33 .. v33}, Lnanoxml/XMLElement;->getName()Ljava/lang/String;

    move-result-object v4

    const-string v5, "hasrepeatevents"

    invoke-virtual {v4, v5}, Ljava/lang/String;->equals(Ljava/lang/Object;)Z

    move-result v4

    if-eqz v4, :cond_3

    .line 488
    invoke-virtual/range {v33 .. v33}, Lnanoxml/XMLElement;->getContent()Ljava/lang/String;

    move-result-object v4

    move-object/from16 v0, p0

    move-object v1, v4

    invoke-direct {v0, v1}, Lorg/microemu/device/impl/DeviceImpl;->parseBoolean(Ljava/lang/String;)Z

    move-result v4

    move v0, v4

    move-object/from16 v1, p0

    iput-boolean v0, v1, Lorg/microemu/device/impl/DeviceImpl;->hasRepeatEvents:Z

    goto :goto_0

    .line 489
    :cond_3
    invoke-virtual/range {v33 .. v33}, Lnanoxml/XMLElement;->getName()Ljava/lang/String;

    move-result-object v4

    const-string v5, "button"

    invoke-virtual {v4, v5}, Ljava/lang/String;->equals(Ljava/lang/Object;)Z

    move-result v4

    if-eqz v4, :cond_c

    .line 490
    const/4 v6, 0x0

    .line 491
    .local v6, shape:Lorg/microemu/device/impl/Shape;
    new-instance v10, Ljava/util/Hashtable;

    invoke-direct {v10}, Ljava/util/Hashtable;-><init>()V

    .line 492
    .local v10, inputToChars:Ljava/util/Hashtable;
    invoke-virtual/range {v33 .. v33}, Lnanoxml/XMLElement;->enumerateChildren()Ljava/util/Enumeration;

    move-result-object v23

    .local v23, e_button:Ljava/util/Enumeration;
    :cond_4
    :goto_1
    invoke-interface/range {v23 .. v23}, Ljava/util/Enumeration;->hasMoreElements()Z

    move-result v4

    if-eqz v4, :cond_b

    .line 493
    invoke-interface/range {v23 .. v23}, Ljava/util/Enumeration;->nextElement()Ljava/lang/Object;

    move-result-object v31

    check-cast v31, Lnanoxml/XMLElement;

    .line 494
    .local v31, tmp_button:Lnanoxml/XMLElement;
    invoke-virtual/range {v31 .. v31}, Lnanoxml/XMLElement;->getName()Ljava/lang/String;

    move-result-object v4

    const-string v5, "chars"

    invoke-virtual {v4, v5}, Ljava/lang/String;->equals(Ljava/lang/Object;)Z

    move-result v4

    if-eqz v4, :cond_9

    .line 495
    const-string v4, "input"

    const-string v5, "common"

    move-object/from16 v0, v31

    move-object v1, v4

    move-object v2, v5

    invoke-virtual {v0, v1, v2}, Lnanoxml/XMLElement;->getStringAttribute(Ljava/lang/String;Ljava/lang/String;)Ljava/lang/String;

    move-result-object v27

    .line 496
    .local v27, input:Ljava/lang/String;
    new-instance v30, Ljava/util/Vector;

    invoke-direct/range {v30 .. v30}, Ljava/util/Vector;-><init>()V

    .line 497
    .local v30, stringArray:Ljava/util/Vector;
    invoke-virtual/range {v31 .. v31}, Lnanoxml/XMLElement;->enumerateChildren()Ljava/util/Enumeration;

    move-result-object v24

    .local v24, e_chars:Ljava/util/Enumeration;
    :cond_5
    :goto_2
    invoke-interface/range {v24 .. v24}, Ljava/util/Enumeration;->hasMoreElements()Z

    move-result v4

    if-eqz v4, :cond_6

    .line 498
    invoke-interface/range {v24 .. v24}, Ljava/util/Enumeration;->nextElement()Ljava/lang/Object;

    move-result-object v32

    check-cast v32, Lnanoxml/XMLElement;

    .line 499
    .local v32, tmp_chars:Lnanoxml/XMLElement;
    invoke-virtual/range {v32 .. v32}, Lnanoxml/XMLElement;->getName()Ljava/lang/String;

    move-result-object v4

    const-string v5, "char"

    invoke-virtual {v4, v5}, Ljava/lang/String;->equals(Ljava/lang/Object;)Z

    move-result v4

    if-eqz v4, :cond_5

    .line 500
    invoke-virtual/range {v32 .. v32}, Lnanoxml/XMLElement;->getContent()Ljava/lang/String;

    move-result-object v4

    move-object/from16 v0, v30

    move-object v1, v4

    invoke-virtual {v0, v1}, Ljava/util/Vector;->addElement(Ljava/lang/Object;)V

    goto :goto_2

    .line 503
    .end local v32           #tmp_chars:Lnanoxml/XMLElement;
    :cond_6
    invoke-virtual/range {v30 .. v30}, Ljava/util/Vector;->size()I

    move-result v4

    move v0, v4

    new-array v0, v0, [C

    move-object/from16 v22, v0

    .line 504
    .local v22, charArray:[C
    const/16 v26, 0x0

    .local v26, i:I
    :goto_3
    invoke-virtual/range {v30 .. v30}, Ljava/util/Vector;->size()I

    move-result v4

    move/from16 v0, v26

    move v1, v4

    if-ge v0, v1, :cond_8

    .line 505
    move-object/from16 v0, v30

    move/from16 v1, v26

    invoke-virtual {v0, v1}, Ljava/util/Vector;->elementAt(I)Ljava/lang/Object;

    move-result-object v29

    check-cast v29, Ljava/lang/String;

    .line 506
    .local v29, str:Ljava/lang/String;
    invoke-virtual/range {v29 .. v29}, Ljava/lang/String;->length()I

    move-result v4

    if-lez v4, :cond_7

    .line 507
    const/4 v4, 0x0

    move-object/from16 v0, v29

    move v1, v4

    invoke-virtual {v0, v1}, Ljava/lang/String;->charAt(I)C

    move-result v4

    aput-char v4, v22, v26

    .line 504
    :goto_4
    add-int/lit8 v26, v26, 0x1

    goto :goto_3

    .line 509
    :cond_7
    const/16 v4, 0x20

    aput-char v4, v22, v26

    goto :goto_4

    .line 512
    .end local v29           #str:Ljava/lang/String;
    :cond_8
    move-object v0, v10

    move-object/from16 v1, v27

    move-object/from16 v2, v22

    invoke-virtual {v0, v1, v2}, Ljava/util/Hashtable;->put(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;

    goto/16 :goto_1

    .line 513
    .end local v27           #input:Ljava/lang/String;
    .end local v30           #stringArray:Ljava/util/Vector;
    .end local v24           #e_chars:Ljava/util/Enumeration;
    .end local v22           #charArray:[C
    .end local v26           #i:I
    :cond_9
    invoke-virtual/range {v31 .. v31}, Lnanoxml/XMLElement;->getName()Ljava/lang/String;

    move-result-object v4

    const-string v5, "rectangle"

    invoke-virtual {v4, v5}, Ljava/lang/String;->equals(Ljava/lang/Object;)Z

    move-result v4

    if-eqz v4, :cond_a

    if-nez v28, :cond_a

    .line 514
    move-object/from16 v0, p0

    move-object/from16 v1, v31

    invoke-direct {v0, v1}, Lorg/microemu/device/impl/DeviceImpl;->getRectangle(Lnanoxml/XMLElement;)Lorg/microemu/device/impl/Rectangle;

    move-result-object v6

    goto/16 :goto_1

    .line 515
    :cond_a
    invoke-virtual/range {v31 .. v31}, Lnanoxml/XMLElement;->getName()Ljava/lang/String;

    move-result-object v4

    const-string v5, "polygon"

    invoke-virtual {v4, v5}, Ljava/lang/String;->equals(Ljava/lang/Object;)Z

    move-result v4

    if-eqz v4, :cond_4

    if-nez v28, :cond_4

    .line 516
    move-object/from16 v0, p0

    move-object/from16 v1, v31

    invoke-direct {v0, v1}, Lorg/microemu/device/impl/DeviceImpl;->getPolygon(Lnanoxml/XMLElement;)Lorg/microemu/device/impl/Polygon;

    move-result-object v6

    .restart local v6       #shape:Lorg/microemu/device/impl/Shape;
    goto/16 :goto_1

    .line 519
    .end local v31           #tmp_button:Lnanoxml/XMLElement;
    :cond_b
    const-string v4, "keyCode"

    const/high16 v5, -0x8000

    move-object/from16 v0, v33

    move-object v1, v4

    move v2, v5

    invoke-virtual {v0, v1, v2}, Lnanoxml/XMLElement;->getIntAttribute(Ljava/lang/String;I)I

    move-result v7

    .line 520
    .local v7, keyCode:I
    invoke-virtual/range {p0 .. p0}, Lorg/microemu/device/impl/DeviceImpl;->getButtons()Ljava/util/Vector;

    move-result-object v12

    move-object/from16 v0, p0

    iget v0, v0, Lorg/microemu/device/impl/DeviceImpl;->skinVersion:I

    move v4, v0

    const-string v5, "name"

    move-object/from16 v0, v33

    move-object v1, v5

    invoke-virtual {v0, v1}, Lnanoxml/XMLElement;->getStringAttribute(Ljava/lang/String;)Ljava/lang/String;

    move-result-object v5

    const-string v8, "key"

    move-object/from16 v0, v33

    move-object v1, v8

    invoke-virtual {v0, v1}, Lnanoxml/XMLElement;->getStringAttribute(Ljava/lang/String;)Ljava/lang/String;

    move-result-object v8

    const-string v9, "keyboardChars"

    move-object/from16 v0, v33

    move-object v1, v9

    invoke-virtual {v0, v1}, Lnanoxml/XMLElement;->getStringAttribute(Ljava/lang/String;)Ljava/lang/String;

    move-result-object v9

    const-string v11, "modeChange"

    const/4 v13, 0x0

    move-object/from16 v0, v33

    move-object v1, v11

    move v2, v13

    invoke-virtual {v0, v1, v2}, Lnanoxml/XMLElement;->getBooleanAttribute(Ljava/lang/String;Z)Z

    move-result v11

    invoke-interface/range {v3 .. v11}, Lorg/microemu/device/impl/DeviceDisplayImpl;->createButton(ILjava/lang/String;Lorg/microemu/device/impl/Shape;ILjava/lang/String;Ljava/lang/String;Ljava/util/Hashtable;Z)Lorg/microemu/device/impl/Button;

    move-result-object v4

    invoke-virtual {v12, v4}, Ljava/util/Vector;->addElement(Ljava/lang/Object;)V

    goto/16 :goto_0

    .line 525
    .end local v10           #inputToChars:Ljava/util/Hashtable;
    .end local v23           #e_button:Ljava/util/Enumeration;
    .end local v6           #shape:Lorg/microemu/device/impl/Shape;
    .end local v7           #keyCode:I
    :cond_c
    invoke-virtual/range {v33 .. v33}, Lnanoxml/XMLElement;->getName()Ljava/lang/String;

    move-result-object v4

    const-string v5, "softbutton"

    invoke-virtual {v4, v5}, Ljava/lang/String;->equals(Ljava/lang/Object;)Z

    move-result v4

    if-eqz v4, :cond_0

    .line 526
    new-instance v19, Ljava/util/Vector;

    invoke-direct/range {v19 .. v19}, Ljava/util/Vector;-><init>()V

    .line 527
    .local v19, commands:Ljava/util/Vector;
    const/4 v6, 0x0

    .line 528
    .restart local v6       #shape:Lorg/microemu/device/impl/Shape;
    const/16 v17, 0x0

    .line 529
    .local v17, paintable:Lorg/microemu/device/impl/Rectangle;
    const/16 v20, 0x0

    .line 530
    .local v20, font:Ljavax/microedition/lcdui/Font;
    invoke-virtual/range {v33 .. v33}, Lnanoxml/XMLElement;->enumerateChildren()Ljava/util/Enumeration;

    move-result-object v23

    .restart local v23       #e_button:Ljava/util/Enumeration;
    :cond_d
    :goto_5
    invoke-interface/range {v23 .. v23}, Ljava/util/Enumeration;->hasMoreElements()Z

    move-result v4

    if-eqz v4, :cond_12

    .line 531
    invoke-interface/range {v23 .. v23}, Ljava/util/Enumeration;->nextElement()Ljava/lang/Object;

    move-result-object v31

    check-cast v31, Lnanoxml/XMLElement;

    .line 532
    .restart local v31       #tmp_button:Lnanoxml/XMLElement;
    invoke-virtual/range {v31 .. v31}, Lnanoxml/XMLElement;->getName()Ljava/lang/String;

    move-result-object v4

    const-string v5, "rectangle"

    invoke-virtual {v4, v5}, Ljava/lang/String;->equals(Ljava/lang/Object;)Z

    move-result v4

    if-eqz v4, :cond_e

    if-nez v28, :cond_e

    .line 533
    move-object/from16 v0, p0

    move-object/from16 v1, v31

    invoke-direct {v0, v1}, Lorg/microemu/device/impl/DeviceImpl;->getRectangle(Lnanoxml/XMLElement;)Lorg/microemu/device/impl/Rectangle;

    move-result-object v6

    .restart local v6       #shape:Lorg/microemu/device/impl/Shape;
    goto :goto_5

    .line 534
    :cond_e
    invoke-virtual/range {v31 .. v31}, Lnanoxml/XMLElement;->getName()Ljava/lang/String;

    move-result-object v4

    const-string v5, "polygon"

    invoke-virtual {v4, v5}, Ljava/lang/String;->equals(Ljava/lang/Object;)Z

    move-result v4

    if-eqz v4, :cond_f

    if-nez v28, :cond_f

    .line 535
    move-object/from16 v0, p0

    move-object/from16 v1, v31

    invoke-direct {v0, v1}, Lorg/microemu/device/impl/DeviceImpl;->getPolygon(Lnanoxml/XMLElement;)Lorg/microemu/device/impl/Polygon;

    move-result-object v6

    .restart local v6       #shape:Lorg/microemu/device/impl/Shape;
    goto :goto_5

    .line 536
    :cond_f
    invoke-virtual/range {v31 .. v31}, Lnanoxml/XMLElement;->getName()Ljava/lang/String;

    move-result-object v4

    const-string v5, "paintable"

    invoke-virtual {v4, v5}, Ljava/lang/String;->equals(Ljava/lang/Object;)Z

    move-result v4

    if-eqz v4, :cond_10

    .line 537
    move-object/from16 v0, p0

    move-object/from16 v1, v31

    invoke-direct {v0, v1}, Lorg/microemu/device/impl/DeviceImpl;->getRectangle(Lnanoxml/XMLElement;)Lorg/microemu/device/impl/Rectangle;

    move-result-object v17

    goto :goto_5

    .line 538
    :cond_10
    invoke-virtual/range {v31 .. v31}, Lnanoxml/XMLElement;->getName()Ljava/lang/String;

    move-result-object v4

    const-string v5, "command"

    invoke-virtual {v4, v5}, Ljava/lang/String;->equals(Ljava/lang/Object;)Z

    move-result v4

    if-eqz v4, :cond_11

    .line 539
    invoke-virtual/range {v31 .. v31}, Lnanoxml/XMLElement;->getContent()Ljava/lang/String;

    move-result-object v4

    move-object/from16 v0, v19

    move-object v1, v4

    invoke-virtual {v0, v1}, Ljava/util/Vector;->addElement(Ljava/lang/Object;)V

    goto :goto_5

    .line 540
    :cond_11
    invoke-virtual/range {v31 .. v31}, Lnanoxml/XMLElement;->getName()Ljava/lang/String;

    move-result-object v4

    const-string v5, "font"

    invoke-virtual {v4, v5}, Ljava/lang/String;->equals(Ljava/lang/Object;)Z

    move-result v4

    if-eqz v4, :cond_d

    .line 541
    const-string v4, "face"

    move-object/from16 v0, v31

    move-object v1, v4

    invoke-virtual {v0, v1}, Lnanoxml/XMLElement;->getStringAttribute(Ljava/lang/String;)Ljava/lang/String;

    move-result-object v4

    const-string v5, "style"

    move-object/from16 v0, v31

    move-object v1, v5

    invoke-virtual {v0, v1}, Lnanoxml/XMLElement;->getStringAttribute(Ljava/lang/String;)Ljava/lang/String;

    move-result-object v5

    const-string v7, "size"

    move-object/from16 v0, v31

    move-object v1, v7

    invoke-virtual {v0, v1}, Lnanoxml/XMLElement;->getStringAttribute(Ljava/lang/String;)Ljava/lang/String;

    move-result-object v7

    invoke-static {v4, v5, v7}, Lorg/microemu/device/impl/DeviceImpl;->getFont(Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;)Ljavax/microedition/lcdui/Font;

    move-result-object v20

    goto/16 :goto_5

    .line 545
    .end local v31           #tmp_button:Lnanoxml/XMLElement;
    :cond_12
    const-string v4, "keyCode"

    const/high16 v5, -0x8000

    move-object/from16 v0, v33

    move-object v1, v4

    move v2, v5

    invoke-virtual {v0, v1, v2}, Lnanoxml/XMLElement;->getIntAttribute(Ljava/lang/String;I)I

    move-result v7

    .line 546
    .restart local v7       #keyCode:I
    move-object/from16 v0, p0

    iget v0, v0, Lorg/microemu/device/impl/DeviceImpl;->skinVersion:I

    move v12, v0

    const-string v4, "name"

    move-object/from16 v0, v33

    move-object v1, v4

    invoke-virtual {v0, v1}, Lnanoxml/XMLElement;->getStringAttribute(Ljava/lang/String;)Ljava/lang/String;

    move-result-object v13

    const-string v4, "key"

    move-object/from16 v0, v33

    move-object v1, v4

    invoke-virtual {v0, v1}, Lnanoxml/XMLElement;->getStringAttribute(Ljava/lang/String;)Ljava/lang/String;

    move-result-object v16

    const-string v4, "alignment"

    move-object/from16 v0, v33

    move-object v1, v4

    invoke-virtual {v0, v1}, Lnanoxml/XMLElement;->getStringAttribute(Ljava/lang/String;)Ljava/lang/String;

    move-result-object v18

    move-object v11, v3

    move-object v14, v6

    move v15, v7

    invoke-interface/range {v11 .. v20}, Lorg/microemu/device/impl/DeviceDisplayImpl;->createSoftButton(ILjava/lang/String;Lorg/microemu/device/impl/Shape;ILjava/lang/String;Lorg/microemu/device/impl/Rectangle;Ljava/lang/String;Ljava/util/Vector;Ljavax/microedition/lcdui/Font;)Lorg/microemu/device/impl/SoftButton;

    move-result-object v21

    .line 550
    .local v21, button:Lorg/microemu/device/impl/SoftButton;
    invoke-virtual/range {p0 .. p0}, Lorg/microemu/device/impl/DeviceImpl;->getButtons()Ljava/util/Vector;

    move-result-object v4

    move-object v0, v4

    move-object/from16 v1, v21

    invoke-virtual {v0, v1}, Ljava/util/Vector;->addElement(Ljava/lang/Object;)V

    .line 551
    invoke-virtual/range {p0 .. p0}, Lorg/microemu/device/impl/DeviceImpl;->getSoftButtons()Ljava/util/Vector;

    move-result-object v4

    move-object v0, v4

    move-object/from16 v1, v21

    invoke-virtual {v0, v1}, Ljava/util/Vector;->addElement(Ljava/lang/Object;)V

    goto/16 :goto_0

    .line 554
    .end local v33           #tmp_keyboard:Lnanoxml/XMLElement;
    .end local v19           #commands:Ljava/util/Vector;
    .end local v23           #e_button:Ljava/util/Enumeration;
    .end local v6           #shape:Lorg/microemu/device/impl/Shape;
    .end local v17           #paintable:Lorg/microemu/device/impl/Rectangle;
    .end local v20           #font:Ljavax/microedition/lcdui/Font;
    .end local v7           #keyCode:I
    .end local v21           #button:Lorg/microemu/device/impl/SoftButton;
    :cond_13
    return-void
.end method

.method private parseSystemProperties(Lnanoxml/XMLElement;)V
    .locals 5
    .parameter "tmp"

    .prologue
    .line 557
    invoke-virtual {p1}, Lnanoxml/XMLElement;->enumerateChildren()Ljava/util/Enumeration;

    move-result-object v0

    .local v0, e_prop:Ljava/util/Enumeration;
    :cond_0
    :goto_0
    invoke-interface {v0}, Ljava/util/Enumeration;->hasMoreElements()Z

    move-result v2

    if-eqz v2, :cond_1

    .line 558
    invoke-interface {v0}, Ljava/util/Enumeration;->nextElement()Ljava/lang/Object;

    move-result-object v1

    check-cast v1, Lnanoxml/XMLElement;

    .line 559
    .local v1, tmp_prop:Lnanoxml/XMLElement;
    invoke-virtual {v1}, Lnanoxml/XMLElement;->getName()Ljava/lang/String;

    move-result-object v2

    const-string v3, "system-property"

    invoke-virtual {v2, v3}, Ljava/lang/String;->equals(Ljava/lang/Object;)Z

    move-result v2

    if-eqz v2, :cond_0

    .line 560
    iget-object v2, p0, Lorg/microemu/device/impl/DeviceImpl;->systemProperties:Ljava/util/Map;

    const-string v3, "name"

    invoke-virtual {v1, v3}, Lnanoxml/XMLElement;->getStringAttribute(Ljava/lang/String;)Ljava/lang/String;

    move-result-object v3

    const-string v4, "value"

    invoke-virtual {v1, v4}, Lnanoxml/XMLElement;->getStringAttribute(Ljava/lang/String;)Ljava/lang/String;

    move-result-object v4

    invoke-interface {v2, v3, v4}, Ljava/util/Map;->put(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;

    goto :goto_0

    .line 563
    .end local v1           #tmp_prop:Lnanoxml/XMLElement;
    :cond_1
    return-void
.end method

.method private static saveDevice(Lnanoxml/XMLElement;)V
    .locals 6
    .parameter "doc"

    .prologue
    .line 689
    new-instance v0, Ljava/io/File;

    const-string v4, "."

    const-string v5, "device-tmp.xml"

    invoke-direct {v0, v4, v5}, Ljava/io/File;-><init>(Ljava/lang/String;Ljava/lang/String;)V

    .line 690
    .local v0, configFile:Ljava/io/File;
    const/4 v2, 0x0

    .line 692
    .local v2, fw:Ljava/io/FileWriter;
    :try_start_0
    new-instance v3, Ljava/io/FileWriter;

    invoke-direct {v3, v0}, Ljava/io/FileWriter;-><init>(Ljava/io/File;)V
    :try_end_0
    .catchall {:try_start_0 .. :try_end_0} :catchall_0
    .catch Ljava/io/IOException; {:try_start_0 .. :try_end_0} :catch_0

    .line 693
    .local v3, fw:Ljava/io/FileWriter;
    :try_start_1
    invoke-virtual {p0, v3}, Lnanoxml/XMLElement;->write(Ljava/io/Writer;)V

    .line 694
    .end local v2           #fw:Ljava/io/FileWriter;
    invoke-virtual {v3}, Ljava/io/FileWriter;->close()V
    :try_end_1
    .catchall {:try_start_1 .. :try_end_1} :catchall_1
    .catch Ljava/io/IOException; {:try_start_1 .. :try_end_1} :catch_1

    .line 698
    invoke-static {v3}, Lorg/microemu/app/util/IOUtils;->closeQuietly(Ljava/io/Writer;)V

    move-object v2, v3

    .line 700
    .end local v3           #fw:Ljava/io/FileWriter;
    .restart local v2       #fw:Ljava/io/FileWriter;
    :goto_0
    return-void

    .line 695
    :catch_0
    move-exception v4

    move-object v1, v4

    .line 696
    .local v1, ex:Ljava/io/IOException;
    :goto_1
    :try_start_2
    sget-object v4, Ljava/lang/System;->out:Ljava/io/PrintStream;

    invoke-virtual {v4, v1}, Ljava/io/PrintStream;->println(Ljava/lang/Object;)V
    :try_end_2
    .catchall {:try_start_2 .. :try_end_2} :catchall_0

    .line 698
    invoke-static {v2}, Lorg/microemu/app/util/IOUtils;->closeQuietly(Ljava/io/Writer;)V

    goto :goto_0

    .end local v1           #ex:Ljava/io/IOException;
    :catchall_0
    move-exception v4

    :goto_2
    invoke-static {v2}, Lorg/microemu/app/util/IOUtils;->closeQuietly(Ljava/io/Writer;)V

    throw v4

    .end local v2           #fw:Ljava/io/FileWriter;
    .restart local v3       #fw:Ljava/io/FileWriter;
    :catchall_1
    move-exception v4

    move-object v2, v3

    .restart local v2       #fw:Ljava/io/FileWriter;
    goto :goto_2

    .line 695
    .end local v2           #fw:Ljava/io/FileWriter;
    :catch_1
    move-exception v4

    move-object v1, v4

    move-object v2, v3

    .restart local v2       #fw:Ljava/io/FileWriter;
    goto :goto_1
.end method


# virtual methods
.method public destroy()V
    .locals 0

    .prologue
    .line 183
    return-void
.end method

.method public getButtons()Ljava/util/Vector;
    .locals 1

    .prologue
    .line 267
    iget-object v0, p0, Lorg/microemu/device/impl/DeviceImpl;->buttons:Ljava/util/Vector;

    return-object v0
.end method

.method public getDescriptorLocation()Ljava/lang/String;
    .locals 1

    .prologue
    .line 174
    iget-object v0, p0, Lorg/microemu/device/impl/DeviceImpl;->descriptorLocation:Ljava/lang/String;

    return-object v0
.end method

.method public getDeviceDisplay()Lorg/microemu/device/DeviceDisplay;
    .locals 1

    .prologue
    .line 222
    iget-object v0, p0, Lorg/microemu/device/impl/DeviceImpl;->context:Lorg/microemu/EmulatorContext;

    invoke-interface {v0}, Lorg/microemu/EmulatorContext;->getDeviceDisplay()Lorg/microemu/device/DeviceDisplay;

    move-result-object v0

    return-object v0
.end method

.method public getEmulatorContext()Lorg/microemu/EmulatorContext;
    .locals 1

    .prologue
    .line 195
    iget-object v0, p0, Lorg/microemu/device/impl/DeviceImpl;->context:Lorg/microemu/EmulatorContext;

    return-object v0
.end method

.method public getFontManager()Lorg/microemu/device/FontManager;
    .locals 1

    .prologue
    .line 213
    iget-object v0, p0, Lorg/microemu/device/impl/DeviceImpl;->context:Lorg/microemu/EmulatorContext;

    invoke-interface {v0}, Lorg/microemu/EmulatorContext;->getDeviceFontManager()Lorg/microemu/device/FontManager;

    move-result-object v0

    return-object v0
.end method

.method public getInputMethod()Lorg/microemu/device/InputMethod;
    .locals 1

    .prologue
    .line 204
    iget-object v0, p0, Lorg/microemu/device/impl/DeviceImpl;->context:Lorg/microemu/EmulatorContext;

    invoke-interface {v0}, Lorg/microemu/EmulatorContext;->getDeviceInputMethod()Lorg/microemu/device/InputMethod;

    move-result-object v0

    return-object v0
.end method

.method public getName()Ljava/lang/String;
    .locals 1

    .prologue
    .line 191
    iget-object v0, p0, Lorg/microemu/device/impl/DeviceImpl;->name:Ljava/lang/String;

    return-object v0
.end method

.method public getNormalImage()Ljavax/microedition/lcdui/Image;
    .locals 1

    .prologue
    .line 231
    iget-object v0, p0, Lorg/microemu/device/impl/DeviceImpl;->normalImage:Ljavax/microedition/lcdui/Image;

    return-object v0
.end method

.method public getOverImage()Ljavax/microedition/lcdui/Image;
    .locals 1

    .prologue
    .line 240
    iget-object v0, p0, Lorg/microemu/device/impl/DeviceImpl;->overImage:Ljavax/microedition/lcdui/Image;

    return-object v0
.end method

.method public getPressedImage()Ljavax/microedition/lcdui/Image;
    .locals 1

    .prologue
    .line 249
    iget-object v0, p0, Lorg/microemu/device/impl/DeviceImpl;->pressedImage:Ljavax/microedition/lcdui/Image;

    return-object v0
.end method

.method public getSoftButtons()Ljava/util/Vector;
    .locals 1

    .prologue
    .line 258
    iget-object v0, p0, Lorg/microemu/device/impl/DeviceImpl;->softButtons:Ljava/util/Vector;

    return-object v0
.end method

.method public getSystemProperties()Ljava/util/Map;
    .locals 1

    .prologue
    .line 685
    iget-object v0, p0, Lorg/microemu/device/impl/DeviceImpl;->systemProperties:Ljava/util/Map;

    return-object v0
.end method

.method public hasPointerEvents()Z
    .locals 1

    .prologue
    .line 649
    iget-boolean v0, p0, Lorg/microemu/device/impl/DeviceImpl;->hasPointerEvents:Z

    return v0
.end method

.method public hasPointerMotionEvents()Z
    .locals 1

    .prologue
    .line 658
    iget-boolean v0, p0, Lorg/microemu/device/impl/DeviceImpl;->hasPointerMotionEvents:Z

    return v0
.end method

.method public hasRepeatEvents()Z
    .locals 1

    .prologue
    .line 667
    iget-boolean v0, p0, Lorg/microemu/device/impl/DeviceImpl;->hasRepeatEvents:Z

    return v0
.end method

.method public init()V
    .locals 0

    .prologue
    .line 139
    return-void
.end method

.method public init(Lorg/microemu/EmulatorContext;)V
    .locals 1
    .parameter "context"

    .prologue
    .line 146
    const-string v0, "org/microemu/device/default/device.xml"

    invoke-virtual {p0, p1, v0}, Lorg/microemu/device/impl/DeviceImpl;->init(Lorg/microemu/EmulatorContext;Ljava/lang/String;)V

    .line 147
    return-void
.end method

.method public init(Lorg/microemu/EmulatorContext;Ljava/lang/String;)V
    .locals 6
    .parameter "context"
    .parameter "descriptorLocation"

    .prologue
    const-string v4, "/"

    .line 154
    iput-object p1, p0, Lorg/microemu/device/impl/DeviceImpl;->context:Lorg/microemu/EmulatorContext;

    .line 155
    const-string v3, "/"

    invoke-virtual {p2, v4}, Ljava/lang/String;->startsWith(Ljava/lang/String;)Z

    move-result v3

    if-eqz v3, :cond_0

    .line 156
    const/4 v3, 0x1

    invoke-virtual {p2, v3}, Ljava/lang/String;->substring(I)Ljava/lang/String;

    move-result-object v3

    iput-object v3, p0, Lorg/microemu/device/impl/DeviceImpl;->descriptorLocation:Ljava/lang/String;

    .line 162
    :goto_0
    const/4 v3, 0x0

    :try_start_0
    const-string v4, "/"

    invoke-virtual {p2, v4}, Ljava/lang/String;->lastIndexOf(Ljava/lang/String;)I

    move-result v4

    invoke-virtual {p2, v3, v4}, Ljava/lang/String;->substring(II)Ljava/lang/String;

    move-result-object v0

    .line 163
    .local v0, base:Ljava/lang/String;
    invoke-virtual {p0}, Ljava/lang/Object;->getClass()Ljava/lang/Class;

    move-result-object v3

    invoke-virtual {v3}, Ljava/lang/Class;->getClassLoader()Ljava/lang/ClassLoader;

    move-result-object v3

    invoke-static {v3, p2}, Lorg/microemu/device/impl/DeviceImpl;->loadDeviceDescriptor(Ljava/lang/ClassLoader;Ljava/lang/String;)Lnanoxml/XMLElement;

    move-result-object v1

    .line 164
    .local v1, doc:Lnanoxml/XMLElement;
    invoke-virtual {p0}, Ljava/lang/Object;->getClass()Ljava/lang/Class;

    move-result-object v3

    invoke-virtual {v3}, Ljava/lang/Class;->getClassLoader()Ljava/lang/ClassLoader;

    move-result-object v3

    invoke-virtual {p0, v3, v0, v1}, Lorg/microemu/device/impl/DeviceImpl;->loadConfig(Ljava/lang/ClassLoader;Ljava/lang/String;Lnanoxml/XMLElement;)V
    :try_end_0
    .catch Ljava/io/IOException; {:try_start_0 .. :try_end_0} :catch_0

    .line 168
    .end local v0           #base:Ljava/lang/String;
    .end local v1           #doc:Lnanoxml/XMLElement;
    :goto_1
    return-void

    .line 158
    :cond_0
    iput-object p2, p0, Lorg/microemu/device/impl/DeviceImpl;->descriptorLocation:Ljava/lang/String;

    goto :goto_0

    .line 165
    :catch_0
    move-exception v3

    move-object v2, v3

    .line 166
    .local v2, ex:Ljava/io/IOException;
    sget-object v3, Ljava/lang/System;->out:Ljava/io/PrintStream;

    new-instance v4, Ljava/lang/StringBuffer;

    invoke-direct {v4}, Ljava/lang/StringBuffer;-><init>()V

    const-string v5, "Cannot load config: "

    invoke-virtual {v4, v5}, Ljava/lang/StringBuffer;->append(Ljava/lang/String;)Ljava/lang/StringBuffer;

    move-result-object v4

    invoke-virtual {v4, v2}, Ljava/lang/StringBuffer;->append(Ljava/lang/Object;)Ljava/lang/StringBuffer;

    move-result-object v4

    invoke-virtual {v4}, Ljava/lang/StringBuffer;->toString()Ljava/lang/String;

    move-result-object v4

    invoke-virtual {v3, v4}, Ljava/io/PrintStream;->println(Ljava/lang/String;)V

    goto :goto_1
.end method

.method protected loadConfig(Ljava/lang/ClassLoader;Ljava/lang/String;Lnanoxml/XMLElement;)V
    .locals 8
    .parameter "classLoader"
    .parameter "base"
    .parameter "doc"
    .annotation system Ldalvik/annotation/Throws;
        value = {
            Ljava/io/IOException;
        }
    .end annotation

    .prologue
    const/4 v5, 0x0

    const-string v7, "src"

    const-string v6, "name"

    .line 271
    const-string v4, "name"

    invoke-virtual {p3, v6}, Lnanoxml/XMLElement;->getStringAttribute(Ljava/lang/String;)Ljava/lang/String;

    move-result-object v0

    .line 272
    .local v0, deviceName:Ljava/lang/String;
    if-eqz v0, :cond_1

    .line 273
    iput-object v0, p0, Lorg/microemu/device/impl/DeviceImpl;->name:Ljava/lang/String;

    .line 278
    :goto_0
    invoke-direct {p0, p3}, Lorg/microemu/device/impl/DeviceImpl;->loadSkinVersion(Lnanoxml/XMLElement;)V

    .line 280
    iput-boolean v5, p0, Lorg/microemu/device/impl/DeviceImpl;->hasPointerEvents:Z

    .line 281
    iput-boolean v5, p0, Lorg/microemu/device/impl/DeviceImpl;->hasPointerMotionEvents:Z

    .line 282
    iput-boolean v5, p0, Lorg/microemu/device/impl/DeviceImpl;->hasRepeatEvents:Z

    .line 284
    invoke-virtual {p0}, Lorg/microemu/device/impl/DeviceImpl;->getFontManager()Lorg/microemu/device/FontManager;

    move-result-object v4

    check-cast v4, Lorg/microemu/device/impl/FontManagerImpl;

    invoke-interface {v4, v5}, Lorg/microemu/device/impl/FontManagerImpl;->setAntialiasing(Z)V

    .line 291
    const-string v4, "display"

    invoke-virtual {p3, v4}, Lnanoxml/XMLElement;->getChild(Ljava/lang/String;)Lnanoxml/XMLElement;

    move-result-object v4

    invoke-direct {p0, p1, p2, v4}, Lorg/microemu/device/impl/DeviceImpl;->parseDisplay(Ljava/lang/ClassLoader;Ljava/lang/String;Lnanoxml/XMLElement;)V

    .line 293
    invoke-virtual {p3}, Lnanoxml/XMLElement;->enumerateChildren()Ljava/util/Enumeration;

    move-result-object v1

    .local v1, e:Ljava/util/Enumeration;
    :cond_0
    :goto_1
    invoke-interface {v1}, Ljava/util/Enumeration;->hasMoreElements()Z

    move-result v4

    if-eqz v4, :cond_3

    .line 294
    invoke-interface {v1}, Ljava/util/Enumeration;->nextElement()Ljava/lang/Object;

    move-result-object v3

    check-cast v3, Lnanoxml/XMLElement;

    .line 295
    .local v3, tmp:Lnanoxml/XMLElement;
    invoke-virtual {v3}, Lnanoxml/XMLElement;->getName()Ljava/lang/String;

    move-result-object v4

    const-string v5, "system-properties"

    invoke-virtual {v4, v5}, Ljava/lang/String;->equals(Ljava/lang/Object;)Z

    move-result v4

    if-eqz v4, :cond_2

    .line 296
    invoke-direct {p0, v3}, Lorg/microemu/device/impl/DeviceImpl;->parseSystemProperties(Lnanoxml/XMLElement;)V

    goto :goto_1

    .line 275
    .end local v1           #e:Ljava/util/Enumeration;
    .end local v3           #tmp:Lnanoxml/XMLElement;
    :cond_1
    iput-object p2, p0, Lorg/microemu/device/impl/DeviceImpl;->name:Ljava/lang/String;

    goto :goto_0

    .line 297
    .restart local v1       #e:Ljava/util/Enumeration;
    .restart local v3       #tmp:Lnanoxml/XMLElement;
    :cond_2
    invoke-virtual {v3}, Lnanoxml/XMLElement;->getName()Ljava/lang/String;

    move-result-object v4

    const-string v5, "img"

    invoke-virtual {v4, v5}, Ljava/lang/String;->equals(Ljava/lang/Object;)Z

    move-result v4

    if-eqz v4, :cond_6

    invoke-virtual {p0}, Lorg/microemu/device/impl/DeviceImpl;->getDeviceDisplay()Lorg/microemu/device/DeviceDisplay;

    move-result-object v4

    check-cast v4, Lorg/microemu/device/impl/DeviceDisplayImpl;

    invoke-interface {v4}, Lorg/microemu/device/impl/DeviceDisplayImpl;->isResizable()Z

    move-result v4

    if-nez v4, :cond_6

    .line 299
    :try_start_0
    const-string v4, "name"

    invoke-virtual {v3, v4}, Lnanoxml/XMLElement;->getStringAttribute(Ljava/lang/String;)Ljava/lang/String;

    move-result-object v4

    const-string v5, "normal"

    invoke-virtual {v4, v5}, Ljava/lang/String;->equals(Ljava/lang/Object;)Z

    move-result v4

    if-eqz v4, :cond_4

    .line 300
    const-string v4, "src"

    invoke-virtual {v3, v4}, Lnanoxml/XMLElement;->getStringAttribute(Ljava/lang/String;)Ljava/lang/String;

    move-result-object v4

    invoke-direct {p0, p1, p2, v4}, Lorg/microemu/device/impl/DeviceImpl;->loadImage(Ljava/lang/ClassLoader;Ljava/lang/String;Ljava/lang/String;)Ljavax/microedition/lcdui/Image;

    move-result-object v4

    iput-object v4, p0, Lorg/microemu/device/impl/DeviceImpl;->normalImage:Ljavax/microedition/lcdui/Image;
    :try_end_0
    .catch Ljava/io/IOException; {:try_start_0 .. :try_end_0} :catch_0

    goto :goto_1

    .line 306
    :catch_0
    move-exception v4

    move-object v2, v4

    .line 307
    .local v2, ex:Ljava/io/IOException;
    sget-object v4, Ljava/lang/System;->out:Ljava/io/PrintStream;

    new-instance v5, Ljava/lang/StringBuffer;

    invoke-direct {v5}, Ljava/lang/StringBuffer;-><init>()V

    const-string v6, "Cannot load "

    invoke-virtual {v5, v6}, Ljava/lang/StringBuffer;->append(Ljava/lang/String;)Ljava/lang/StringBuffer;

    move-result-object v5

    const-string v6, "src"

    invoke-virtual {v3, v7}, Lnanoxml/XMLElement;->getStringAttribute(Ljava/lang/String;)Ljava/lang/String;

    move-result-object v6

    invoke-virtual {v5, v6}, Ljava/lang/StringBuffer;->append(Ljava/lang/String;)Ljava/lang/StringBuffer;

    move-result-object v5

    invoke-virtual {v5}, Ljava/lang/StringBuffer;->toString()Ljava/lang/String;

    move-result-object v5

    invoke-virtual {v4, v5}, Ljava/io/PrintStream;->println(Ljava/lang/String;)V

    .line 317
    .end local v3           #tmp:Lnanoxml/XMLElement;
    .end local v2           #ex:Ljava/io/IOException;
    :cond_3
    return-void

    .line 301
    .restart local v3       #tmp:Lnanoxml/XMLElement;
    :cond_4
    :try_start_1
    const-string v4, "name"

    invoke-virtual {v3, v4}, Lnanoxml/XMLElement;->getStringAttribute(Ljava/lang/String;)Ljava/lang/String;

    move-result-object v4

    const-string v5, "over"

    invoke-virtual {v4, v5}, Ljava/lang/String;->equals(Ljava/lang/Object;)Z

    move-result v4

    if-eqz v4, :cond_5

    .line 302
    const-string v4, "src"

    invoke-virtual {v3, v4}, Lnanoxml/XMLElement;->getStringAttribute(Ljava/lang/String;)Ljava/lang/String;

    move-result-object v4

    invoke-direct {p0, p1, p2, v4}, Lorg/microemu/device/impl/DeviceImpl;->loadImage(Ljava/lang/ClassLoader;Ljava/lang/String;Ljava/lang/String;)Ljavax/microedition/lcdui/Image;

    move-result-object v4

    iput-object v4, p0, Lorg/microemu/device/impl/DeviceImpl;->overImage:Ljavax/microedition/lcdui/Image;

    goto/16 :goto_1

    .line 303
    :cond_5
    const-string v4, "name"

    invoke-virtual {v3, v4}, Lnanoxml/XMLElement;->getStringAttribute(Ljava/lang/String;)Ljava/lang/String;

    move-result-object v4

    const-string v5, "pressed"

    invoke-virtual {v4, v5}, Ljava/lang/String;->equals(Ljava/lang/Object;)Z

    move-result v4

    if-eqz v4, :cond_0

    .line 304
    const-string v4, "src"

    invoke-virtual {v3, v4}, Lnanoxml/XMLElement;->getStringAttribute(Ljava/lang/String;)Ljava/lang/String;

    move-result-object v4

    invoke-direct {p0, p1, p2, v4}, Lorg/microemu/device/impl/DeviceImpl;->loadImage(Ljava/lang/ClassLoader;Ljava/lang/String;Ljava/lang/String;)Ljavax/microedition/lcdui/Image;

    move-result-object v4

    iput-object v4, p0, Lorg/microemu/device/impl/DeviceImpl;->pressedImage:Ljavax/microedition/lcdui/Image;
    :try_end_1
    .catch Ljava/io/IOException; {:try_start_1 .. :try_end_1} :catch_0

    goto/16 :goto_1

    .line 310
    :cond_6
    invoke-virtual {v3}, Lnanoxml/XMLElement;->getName()Ljava/lang/String;

    move-result-object v4

    const-string v5, "fonts"

    invoke-virtual {v4, v5}, Ljava/lang/String;->equals(Ljava/lang/Object;)Z

    move-result v4

    if-eqz v4, :cond_7

    .line 311
    invoke-direct {p0, p1, p2, v3}, Lorg/microemu/device/impl/DeviceImpl;->parseFonts(Ljava/lang/ClassLoader;Ljava/lang/String;Lnanoxml/XMLElement;)V

    goto/16 :goto_1

    .line 312
    :cond_7
    invoke-virtual {v3}, Lnanoxml/XMLElement;->getName()Ljava/lang/String;

    move-result-object v4

    const-string v5, "input"

    invoke-virtual {v4, v5}, Ljava/lang/String;->equals(Ljava/lang/Object;)Z

    move-result v4

    if-nez v4, :cond_8

    invoke-virtual {v3}, Lnanoxml/XMLElement;->getName()Ljava/lang/String;

    move-result-object v4

    const-string v5, "keyboard"

    invoke-virtual {v4, v5}, Ljava/lang/String;->equals(Ljava/lang/Object;)Z

    move-result v4

    if-eqz v4, :cond_0

    .line 314
    :cond_8
    invoke-direct {p0, v3}, Lorg/microemu/device/impl/DeviceImpl;->parseInput(Lnanoxml/XMLElement;)V

    goto/16 :goto_1
.end method

.method public vibrate(I)Z
    .locals 1
    .parameter "duration"

    .prologue
    .line 676
    const/4 v0, 0x0

    return v0
.end method
